Skip to content

Commit

Permalink
[BDB-3] Handle ApplyConfigurationsFromAssembly in BaseDbContext (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
phamhongphuc1403 authored Aug 11, 2024
1 parent b2b6149 commit a52ebe7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,6 +18,8 @@ protected BaseDbContext(DbContextOptions options, ICurrentUser currentUser, IMed

protected override void OnModelCreating(ModelBuilder builder)
{
builder.ApplyConfigurationsFromAssembly(GetType().Assembly);

base.OnModelCreating(builder);
}

Expand Down

0 comments on commit a52ebe7

Please sign in to comment.