using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; namespace Common.Models.DBDomain { public class Author : BaseEntity { [Key] public string Url { get; set; } public string Name { get; set; } [JsonIgnore] public List Novels { get; set; } protected bool Equals(Author other) { return Url == other.Url; } public override bool Equals(object? obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != this.GetType()) return false; return Equals((Author) obj); } public override int GetHashCode() { return Url.GetHashCode(); } } }