Add Team functions

This commit is contained in:
2025-09-22 12:53:46 -04:00
parent 3daa3b81b3
commit dc83a18d76
48 changed files with 2364 additions and 633 deletions
+20 -1
View File
@@ -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;
}
}