using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Model { public class Book : IEquatable { public string Id { get; set; } public string Title { get; set; } public List Publishers { get; set; } = new List(); public DateTime PublishDate { get; set; } public string ISBN13 { get; set; } public List Series { get; set; } = new List(); public int NbPages { get; set; } public string Format { get; set; } public Languages Language { get; set; } public List Contributors { get; set; } public string ImageSmall => $"https://covers.openlibrary.org/b/isbn/{ISBN13}-S.jpg"; public string ImageMedium => $"https://covers.openlibrary.org/b/isbn/{ISBN13}-M.jpg"; public string ImageLarge => $"https://covers.openlibrary.org/b/isbn/{ISBN13}-L.jpg"; public List Works { get; set; } = new List(); public List Authors { get; set; } = new List(); public Status Status { get; set; } public List UserTags { get; set; } = new List(); public float? UserRating { get; set; } public string UserNote { get; set; } public bool Equals(Book? 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 Book); } public override int GetHashCode() => Id.GetHashCode(); } }