From b6f8927a16936bda51168ab2de7467272a0e1454 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 10 Aug 2023 17:42:01 +0330 Subject: [PATCH] Fix model builder bug --- .../EasyMicroservices.Cores.EntityFrameworkCore/CoreContext.cs | 2 +- .../EasyMicroservices.Cores.EntityFrameworkCore.csproj | 2 +- ...asyMicroservices.Cores.Relational.EntityFrameworkCore.csproj | 2 +- .../RelationalCoreContext.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/CoreContext.cs b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/CoreContext.cs index 18eca7d..61d91b5 100644 --- a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/CoreContext.cs +++ b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/CoreContext.cs @@ -18,7 +18,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); - foreach (var entityType in Model.GetEntityTypes()) + foreach (var entityType in modelBuilder.Model.GetEntityTypes()) { if (typeof(IUniqueIdentitySchema).IsAssignableFrom(entityType.ClrType)) { diff --git a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj index eb74f52..4b3de1a 100644 --- a/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.EntityFrameworkCore/EasyMicroservices.Cores.EntityFrameworkCore.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 ef core of database. EasyMicroservices@gmail.com core,cores,base,database,ef,efcore diff --git a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj index 6c913a5..ed89ad5 100644 --- a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj +++ b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/EasyMicroservices.Cores.Relational.EntityFrameworkCore.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.2 + 0.0.0.3 ef core of Relational database. EasyMicroservices@gmail.com core,cores,base,database,ef,efcore,Relational diff --git a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/RelationalCoreContext.cs b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/RelationalCoreContext.cs index cd7c48a..f92f733 100644 --- a/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/RelationalCoreContext.cs +++ b/src/CSharp/EasyMicroservices.Cores.Relational.EntityFrameworkCore/RelationalCoreContext.cs @@ -17,7 +17,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); - foreach (var entityType in Model.GetEntityTypes()) + foreach (var entityType in modelBuilder.Model.GetEntityTypes()) { if (typeof(IUniqueIdentitySchema).IsAssignableFrom(entityType.ClrType)) {