2026-04-11 21:36:05 +02:00

20 lines
617 B
C#

using Microsoft.EntityFrameworkCore;
using OnlyPrompt.Backend.Database.Core;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace OnlyPrompt.Backend.Database.Models
{
[Index(nameof(Slug), IsUnique = true)]
public class CategoryModel : EntityBase, IHasSlug
{
[MaxLength(ModelConstants.MaxSlugLength)]
[Column(TypeName = "citext")]
public required string Slug { get; set; }
public required string Name { get; set; }
public string? Description { get; set; }
public virtual IList<PromptModel> Prompts { get; set; } = new List<PromptModel>();
}
}