Add key length annotation to Identifiable

This commit is contained in:
2025-09-01 21:50:00 +02:00
parent 29d21f06e5
commit 1c6398414d
12 changed files with 1065 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace API.Schema;
@@ -15,6 +16,8 @@ public abstract class Identifiable
this.Key = key;
}
[Required]
[StringLength(TokenGen.MaximumLength, MinimumLength = TokenGen.MinimumLength)]
public string Key { get; init; }
public override string ToString() => Key;