2023-08-11 15:51:20 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2023-08-08 21:03:41 +01:00
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
|
|
namespace OliverBooth.Data.Web.Configuration;
|
|
|
|
|
|
|
|
/// <summary>
|
2023-08-13 13:27:44 +01:00
|
|
|
/// Represents the configuration for the <see cref="Template" /> entity.
|
2023-08-08 21:03:41 +01:00
|
|
|
/// </summary>
|
2023-08-13 13:27:44 +01:00
|
|
|
internal sealed class TemplateConfiguration : IEntityTypeConfiguration<Template>
|
2023-08-08 21:03:41 +01:00
|
|
|
{
|
2023-08-13 13:27:44 +01:00
|
|
|
public void Configure(EntityTypeBuilder<Template> builder)
|
2023-08-08 21:03:41 +01:00
|
|
|
{
|
2023-08-13 13:27:44 +01:00
|
|
|
builder.ToTable("Template");
|
2023-08-08 21:03:41 +01:00
|
|
|
builder.HasKey(e => e.Name);
|
|
|
|
|
|
|
|
builder.Property(e => e.Name).IsRequired();
|
|
|
|
builder.Property(e => e.FormatString).IsRequired();
|
|
|
|
}
|
|
|
|
}
|