diff --git a/Src/Product.Infrastructure/Data/Context/CommandContext.cs b/Src/Product.Infrastructure/Data/Context/CommandContext.cs index 4c506b0..b6dd5e0 100644 --- a/Src/Product.Infrastructure/Data/Context/CommandContext.cs +++ b/Src/Product.Infrastructure/Data/Context/CommandContext.cs @@ -4,5 +4,8 @@ namespace Product.Infrastructure.Data.Context; public class CommandContext : DbContext { - + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.ApplyConfigurationsFromAssembly(typeof(IEntityTypeConfiguration<>).Assembly); + } } \ No newline at end of file diff --git a/Src/Product.Infrastructure/Data/Context/QueryContext.cs b/Src/Product.Infrastructure/Data/Context/QueryContext.cs index df0d564..d6dc82d 100644 --- a/Src/Product.Infrastructure/Data/Context/QueryContext.cs +++ b/Src/Product.Infrastructure/Data/Context/QueryContext.cs @@ -8,5 +8,8 @@ public QueryContext(DbContextOptions options) : base(options) { } - + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.ApplyConfigurationsFromAssembly(typeof(IEntityTypeConfiguration<>).Assembly); + } } \ No newline at end of file