Changed oder of response codes. changed HoursPerWeek to use float not int. Changed AssociatedIdentifierCount to use count property on AssociatedIdentifiers instead of needing to populate separately. Changed UserCount in UserList for the same reason. Added Users list initialisation to prevent null ref exception. overrode Equals and GetHashCode to allow use of List.Except method. (tests show without this, Except is useless).
24 lines
687 B
C#
24 lines
687 B
C#
namespace Interfaces
|
|
{
|
|
public class Identifier
|
|
{
|
|
public int Id { get; set; }
|
|
public string UniqueId { get; set; }
|
|
public bool IsAssociatedToUser { get; set; }
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
var identObj = obj as Identifier;
|
|
if (identObj == null) return false;
|
|
|
|
return identObj.Id == Id
|
|
&& identObj.IsAssociatedToUser == IsAssociatedToUser
|
|
&& identObj.UniqueId == UniqueId;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return Id.GetHashCode() ^ UniqueId.GetHashCode() ^ IsAssociatedToUser.GetHashCode();
|
|
}
|
|
}
|
|
} |