2020-12-20 00:18:53 +02:00
|
|
|
|
using IdentityServer.Domain.Data.EntityTypeConfiguration;
|
|
|
|
|
using IdentityServer.Domain.Entities;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace IdentityServer.Domain.Data.DbContexts
|
|
|
|
|
{
|
|
|
|
|
public class IdentityDbContext : DbContext
|
|
|
|
|
{
|
2021-11-12 01:37:10 +02:00
|
|
|
|
public DbSet<AppUser> Users { get; set; }
|
2020-12-20 00:18:53 +02:00
|
|
|
|
|
|
|
|
|
public IdentityDbContext(DbContextOptions<IdentityDbContext> options)
|
|
|
|
|
: base(options)
|
|
|
|
|
{
|
|
|
|
|
base.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
|
|
|
|
|
base.ChangeTracker.AutoDetectChangesEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
|
2021-11-12 01:37:10 +02:00
|
|
|
|
modelBuilder.ApplyConfiguration(new UserStatusConfiguration());
|
2020-12-20 00:18:53 +02:00
|
|
|
|
modelBuilder.ApplyConfiguration(new AppUserConfiguration());
|
2021-11-12 01:37:10 +02:00
|
|
|
|
modelBuilder.ApplyConfiguration(new UserClaimConfiguration());
|
2020-12-20 00:18:53 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|