using DigitalOps.Dal.DbEntity; using Microsoft.EntityFrameworkCore; using Npgsql; namespace DigitalOps.Dal; public class MainDbContext(DbContextOptions options) : MainDbScaffoldedContext(options) { static MainDbContext() => NpgsqlConnection.GlobalTypeMapper .MapEnum("organization_role"); protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.HasPostgresEnum("organization_role"); modelBuilder.Entity(entity => { entity.Property(organizationUser => organizationUser.Role) .HasColumnName("role") .HasColumnType("organization_role"); }); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { return; } }