using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Model { public class Work : IEquatable { public string Id { get; set; } public string Description { get; set; } public string Title { get; set; } public List Subjects { get; set; } = new List(); public List Authors { get; set; } = new List(); public Ratings Ratings { get; set; } public bool Equals(Work? other) => Id == other.Id; public override bool Equals(object? obj) { if (ReferenceEquals(obj, null)) return false; if (ReferenceEquals(this, obj)) return true; if (GetType() != obj.GetType()) return false; return Equals(obj as Work); } public override int GetHashCode() => Id.GetHashCode(); } }