32 lines
915 B
C#
32 lines
915 B
C#
using AccountManagement.Domain.PmDomains.PmRoleAgg;
|
|
using AccountManagement.Domain.PmDomains.PmUserAgg;
|
|
using AccountMangement.Infrastructure.EFCore.Mappings;
|
|
using AccountMangement.Infrastructure.EFCore.Mappings.PmMappings;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace AccountMangement.Infrastructure.EFCore.PmDbConetxt;
|
|
|
|
public class PmDbContext : DbContext
|
|
{
|
|
public PmDbContext(DbContextOptions<PmDbContext> options) : base(options)
|
|
{
|
|
|
|
}
|
|
public DbSet<PmUser> Users { get; set; } = null!;
|
|
public DbSet<PmRole> PmRoles { get; set; } = null!;
|
|
|
|
|
|
public PmDbContext()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
var assembly = typeof(PmUserMapping).Assembly;
|
|
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
|
|
//SubAccountPermissionSeeder.Seed(modelBuilder);
|
|
base.OnModelCreating(modelBuilder);
|
|
}
|
|
} |