2023-08-11 15:51:20 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2023-08-09 21:08:57 +01:00
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
2024-03-02 00:43:56 +00:00
|
|
|
namespace OliverBooth.Common.Data.Web.Configuration;
|
2023-08-09 21:08:57 +01:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Represents the configuration for the <see cref="SiteConfiguration" /> entity.
|
|
|
|
/// </summary>
|
|
|
|
internal sealed class SiteConfigurationConfiguration : IEntityTypeConfiguration<SiteConfiguration>
|
|
|
|
{
|
|
|
|
/// <inheritdoc />
|
|
|
|
public void Configure(EntityTypeBuilder<SiteConfiguration> builder)
|
|
|
|
{
|
|
|
|
builder.ToTable("SiteConfig");
|
|
|
|
builder.HasKey(x => x.Key);
|
|
|
|
|
|
|
|
builder.Property(x => x.Key).HasMaxLength(50).IsRequired();
|
|
|
|
builder.Property(x => x.Value).HasMaxLength(1000);
|
|
|
|
}
|
|
|
|
}
|