2023-08-13 13:27:44 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
2023-08-13 17:33:54 +01:00
|
|
|
namespace OliverBooth.Data.Blog.Configuration;
|
2023-08-13 13:27:44 +01:00
|
|
|
|
|
|
|
/// <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();
|
|
|
|
}
|
|
|
|
}
|