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

20 lines
594 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace OliverBooth.Blog.Data.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();
}
}