Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
CompetitionBasicEqualityComparer.cs
2{
9 public class CompetitionBasicEqualityComparer : IEqualityComparer<Competition>
10 {
17 public bool Equals(Competition x, Competition y)
18 {
19 if (ReferenceEquals(x, y)) return true;
20 if (ReferenceEquals(x, null)) return false;
21 if (ReferenceEquals(y, null)) return false;
22 if (x.GetType() != y.GetType()) return false;
23
24 return (x.Gender, x.SwimmingStyle, x.Age).Equals((y.Gender, y.SwimmingStyle, y.Age));
25 }
26
32 public int GetHashCode(Competition obj)
33 => obj == null ? 0 : (obj.Gender, obj.SwimmingStyle, obj.Age).GetHashCode();
34 }
35}
Comparer that only uses the most basic properties of a Competition to determine equality:
bool Equals(Competition x, Competition y)
Check if two Competition objects are equal based on basic properties.
int GetHashCode(Competition obj)
Get the hash code for a Competition object based on basic properties.
Class describing a competition.
Genders Gender
Gender for this competition.
SwimmingStyles SwimmingStyle
Swimming style for this competition.
byte Age
Age for the person that is assigned for this competition.