diff --git a/Infrastructures/BuildingBlock.Infrastructure.EntityFrameworkCore/BaseDbContext.cs b/Infrastructures/BuildingBlock.Infrastructure.EntityFrameworkCore/BaseDbContext.cs index c0d045a..bf55cf8 100644 --- a/Infrastructures/BuildingBlock.Infrastructure.EntityFrameworkCore/BaseDbContext.cs +++ b/Infrastructures/BuildingBlock.Infrastructure.EntityFrameworkCore/BaseDbContext.cs @@ -5,7 +5,7 @@ namespace BuildingBlock.Infrastructure.EntityFrameworkCore; -public class BaseDbContext : DbContext +public abstract class BaseDbContext : DbContext { private readonly ICurrentUser _currentUser; private readonly IMediator _mediator; @@ -18,6 +18,8 @@ protected BaseDbContext(DbContextOptions options, ICurrentUser currentUser, IMed protected override void OnModelCreating(ModelBuilder builder) { + builder.ApplyConfigurationsFromAssembly(GetType().Assembly); + base.OnModelCreating(builder); }