Add Team functions
This commit is contained in:
@@ -3,7 +3,7 @@ using static System.Text.RegularExpressions.Regex;
|
||||
|
||||
namespace Core.Entities;
|
||||
|
||||
public class Student
|
||||
public class Student : IEquatable<Student>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -74,4 +74,23 @@ public class Student
|
||||
|
||||
public bool VotingDelegate => OfficerRole is Entities.OfficerRole.President or Entities.OfficerRole.VicePresident;
|
||||
|
||||
public bool Equals(Student? other)
|
||||
{
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return Id == other.Id;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((Student)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user