32 lines
819 B
C#
32 lines
819 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Treestar.Shared.Models.DBDomain
|
|
{
|
|
public class Author : BaseEntity
|
|
{
|
|
[Key]
|
|
public string Url { get; set; }
|
|
public string Name { get; set; }
|
|
[JsonIgnore]
|
|
public List<Novel> 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();
|
|
}
|
|
}
|
|
} |