22 lines
681 B
C#
22 lines
681 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
namespace Hcs.WebApp.Data.Hcs
|
|
{
|
|
public class HcsDbContext(DbContextOptions<HcsDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<Registry> Registries { get; set; }
|
|
|
|
public DbSet<RegistryElement> Elements { get; set; }
|
|
|
|
public DbSet<Operation> Operations { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<Operation>()
|
|
.Property(x => x.Type)
|
|
.HasConversion(new EnumToStringConverter<Operation.OperationType>());
|
|
}
|
|
}
|
|
}
|