using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using Treestar.Shared.Models.Enums; namespace Treestar.Shared.Models.DBDomain { [Index(nameof(Guid))] public class Novel : BaseEntity { [Key] public string Url { get; set; } public Guid Guid { get; set; } public string Title { get; set; } public Author? Author { get; set; } public List Tags { get; set; } public List Chapters { get; set; } public NovelStatus Status { get; set; } public DateTime LastUpdated { get; set; } public DateTime DatePosted { get; set; } protected bool Equals(Novel 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((Novel) obj); } public override int GetHashCode() { return Url.GetHashCode(); } } }