using Data.EF.Dice.Faces; using Data.EF.Games; using Data.EF.Joins; using System.Diagnostics.CodeAnalysis; namespace Data.EF.Dice { /// /// not designed to be instantiated, but not abstract in order to allow extensions /// /// public class DieEntity : IEqualityComparer { public Guid ID { get; set; } public ICollection Faces { get; set; } = new List(); // one to many public ICollection Turns { get; set; } = new List(); // many to many public List DieTurns { get; set; } = new(); public bool Equals(DieEntity x, DieEntity y) { return x is not null && y is not null && x.ID.Equals(y.ID) && x.Faces.Equals(y.Faces); } public int GetHashCode([DisallowNull] DieEntity obj) { return HashCode.Combine(ID, Faces); } } }