20 lines
617 B
C#
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>();
|
|
}
|
|
}
|