mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 20:08:19 +02:00
Add API
This commit is contained in:
16
API/Schema/Author.cs
Normal file
16
API/Schema/Author.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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; } = [];
|
||||
}
|
Reference in New Issue
Block a user