oliverbooth.dev/OliverBooth/Data/Web/Configuration/TemplateConfiguration.cs

20 lines
593 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace OliverBooth.Data.Web.Configuration;
/// <summary>
/// Represents the configuration for the <see cref="Template" /> entity.
/// </summary>
internal sealed class TemplateConfiguration : IEntityTypeConfiguration<Template>
{
public void Configure(EntityTypeBuilder<Template> builder)
{
builder.ToTable("Template");
builder.HasKey(e => e.Name);
builder.Property(e => e.Name).IsRequired();
builder.Property(e => e.FormatString).IsRequired();
}
}