using Core.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Data.Configurations; public class PrintPresetConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(p => p.Id); builder.Property(p => p.Name) .IsRequired() .HasMaxLength(100); builder.HasIndex(p => p.Name) .IsUnique(); builder.Property(p => p.EntityType) .HasConversion() .HasMaxLength(32) .IsRequired(); builder.Property(p => p.FiltersJson) .IsRequired() .HasColumnType("TEXT"); builder.Property(p => p.TemplateMarkdown) .IsRequired() .HasColumnType("TEXT"); } }