using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Hcs.WebApp.Data.Hcs { public class HcsDbContext(DbContextOptions options) : DbContext(options) { public DbSet Registries { get; set; } public DbSet Elements { get; set; } public DbSet Campaigns { get; set; } public DbSet Operations { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .Property(x => x.Type) .HasConversion(new EnumToStringConverter()); modelBuilder.Entity() .Property(x => x.Type) .HasConversion(new EnumToStringConverter()); } } }