You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when saving an entity with many-to-many relation to another entity (as described here), BulkSaveChanges throws an exception:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.<>c.<SaveChangesAsync>b__2_3(IEntityType e)
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.<>c__DisplayClass2_0.<SaveChangesAsync>b__6(<>f__AnonymousType1`4 g)
at Medallion.Collections.TopologicalSorter.TopologicalSort[TElement](ITopologicalSortProvider`1 provider)+MoveNext()
at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
at System.Linq.Enumerable.ConcatIterator`1.ToList()
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.SaveChangesAsync(DbContext context, BulkConfig bulkConfig, Action`1 progress, Boolean isAsync, CancellationToken cancellationToken)
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.SaveChanges(DbContext context, BulkConfig bulkConfig, Action`1 progress)
at EFCore.BulkExtensions.DbContextBulkTransaction.Execute[T](DbContext context, Type type, IEnumerable`1 entities, OperationType operationType, BulkConfig bulkConfig, Action`1 progress)
at EFCore.BulkExtensions.DbContextBulkExtensions.BulkSaveChanges(DbContext context, BulkConfig bulkConfig, Action`1 progress)
...
The code throwing the exception (private static async Task SaveChangesAsync(...))
There was a related, possibly same, but closed issue: 1311
We have a scaffolded model, the generated configuration looks like this:
The UsingEntity<Dictionary<string, object>> is in accordance to the last "Important" note of the "Basic many-to-many" section on MSDN ). We use .net8 and EFCoreSqlServer 8.0.8.
The issue seems to be with the Dictionary used for the many-to-many relationship entity, because it does not have an EntityType for the toplogical sort.
The text was updated successfully, but these errors were encountered:
Hello, I have talked to our PM about this issue and he approved me to create the minimal example when there is some free time, hopefully ASAP. Thank you!
Hello,
when saving an entity with many-to-many relation to another entity (as described here), BulkSaveChanges throws an exception:
The code throwing the exception (private static async Task SaveChangesAsync(...))
There was a related, possibly same, but closed issue: 1311
We have a scaffolded model, the generated configuration looks like this:
The
UsingEntity<Dictionary<string, object>>
is in accordance to the last "Important" note of the "Basic many-to-many" section on MSDN ). We use .net8 and EFCoreSqlServer 8.0.8.The issue seems to be with the Dictionary used for the many-to-many relationship entity, because it does not have an EntityType for the toplogical sort.
The text was updated successfully, but these errors were encountered: