ASPTemplate/Backend/Database/Tables/Config.cs
2023-04-08 12:48:27 +02:00

19 lines
586 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace ASPTemplate.Backend.Database.Tables;
public class Config {
public string Key { get; set; } = null!;
public string Value { get; set; } = null!;
public class Configuration : IEntityTypeConfiguration<Config> {
public void Configure(EntityTypeBuilder<Config> builder) {
builder.ToTable("Config");
builder.HasKey(p => p.Key);
builder.Property(b => b.Key).HasColumnName("Key").IsRequired();
builder.Property(b => b.Value).HasColumnName("Value").IsRequired();
}
}
}