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>
|
|
|
|
/// Represents the configuration for the <see cref="ArticleTemplate" /> entity.
|
|
|
|
/// </summary>
|
|
|
|
internal sealed class ArticleTemplateConfiguration : IEntityTypeConfiguration<ArticleTemplate>
|
|
|
|
{
|
|
|
|
public void Configure(EntityTypeBuilder<ArticleTemplate> builder)
|
|
|
|
{
|
|
|
|
builder.ToTable("ArticleTemplate");
|
|
|
|
builder.HasKey(e => e.Name);
|
|
|
|
|
|
|
|
builder.Property(e => e.Name).IsRequired();
|
|
|
|
builder.Property(e => e.FormatString).IsRequired();
|
|
|
|
}
|
|
|
|
}
|