Tranga/API/Schema/Author.cs

19 lines
508 B
C#
Raw Normal View History

2024-12-14 21:53:29 +01:00
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;
2024-12-16 19:25:22 +01:00
public override bool Equals(object? obj)
{
if (obj is not Author other)
return false;
return other.AuthorName == AuthorName;
}
2024-12-14 21:53:29 +01:00
}