artiomchi / FlexLabs.Upsert

FlexLabs.Upsert is a library that brings UPSERT functionality to common database providers for Entity Framework in their respective native SQL syntax
MIT License
516 stars 81 forks source link

Exception when upgrading to .NET 6 and ef core 6 #121

Open jjxtra opened 2 years ago

jjxtra commented 2 years ago

Seeing this in my logs, looks like something broke with the .NET 6 or entity framework core 6 upgrade... I'm using nuget 6.0.1. No compile errors.

Perhaps IModel FindEntityType was removed or linked inproperly?

I built from and included the source instead of the nuget and it worked fine.

 System.MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Metadata.IEntityType Microsoft.EntityFrameworkCore.ModelExtensions.FindEntityType(Microsoft.EntityFrameworkCore.Metadata.IModel, System.Type)'.'.
   at FlexLabs.EntityFrameworkCore.Upsert.UpsertCommandBuilder`1..ctor(DbContext dbContext, ICollection`1 entities)
   at Microsoft.EntityFrameworkCore.UpsertExtensions.UpsertRange[TEntity](DbContext dbContext, IEnumerable`1 entities) in /_/src/FlexLabs.EntityFrameworkCore.Upsert/UpsertExtensions.cs:line 73
   at Microsoft.EntityFrameworkCore.UpsertExtensions.UpsertRange[TEntity](DbSet`1 dbSet, IEnumerable`1 entities) in /_/src/FlexLabs.EntityFrameworkCore.Upsert/UpsertExtensions.cs:line 130