mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-21 13:43:01 +02:00
20 lines
499 B
C#
20 lines
499 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Schema;
|
|
|
|
[PrimaryKey("AuthorId")]
|
|
public class Author(string authorName)
|
|
{
|
|
[StringLength(64)]
|
|
[Required]
|
|
public string AuthorId { get; init; } = TokenGen.CreateToken(typeof(Author), authorName);
|
|
[StringLength(128)]
|
|
[Required]
|
|
public string AuthorName { get; init; } = authorName;
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{AuthorId} {AuthorName}";
|
|
}
|
|
} |