mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 15:50:13 +01:00
19 lines
508 B
C#
19 lines
508 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Schema;
|
|
|
|
[PrimaryKey("AuthorId")]
|
|
public class Author(string authorName)
|
|
{
|
|
[MaxLength(64)]
|
|
public string AuthorId { get; init; } = TokenGen.CreateToken(typeof(Author), 64);
|
|
public string AuthorName { get; init; } = authorName;
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (obj is not Author other)
|
|
return false;
|
|
return other.AuthorName == AuthorName;
|
|
}
|
|
} |