Skip to content

Commit b2751f7

Browse files
authored
Handle multiple DbSets using the same class as OwnedType (#69)
1 parent d502ee5 commit b2751f7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/PhenX.EntityFrameworkCore.BulkInsert/Metadata/MetadataProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ private Dictionary<Type, TableMetadata> GetTables(DbContext context)
3333

3434
var provider = context.GetService<IBulkInsertProvider>();
3535

36-
tables =
37-
context.Model.GetEntityTypes()
36+
tables = context.Model.GetEntityTypes()
37+
.GroupBy(x => x.ClrType)
3838
.ToDictionary(
39-
x => x.ClrType,
40-
x => new TableMetadata(x, provider.SqlDialect));
39+
x => x.Key,
40+
x => new TableMetadata(x.First(), provider.SqlDialect));
4141

4242
_tablesPerContext[type] = tables;
4343

0 commit comments

Comments
 (0)