Tranga/API/Schema/Author.cs
2024-12-14 21:53:29 +01:00

16 lines
485 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
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;
[ForeignKey("MangaIds")]
public virtual Manga[] Mangas { get; internal set; } = [];
}