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
I'm getting the following exception when calling dbContext.BulkSaveChanges():
System.NullReferenceException: Object reference not set to an instance of an object.
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.<>c.b__2_3(IEntityType e)
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.<>c__DisplayClass2_0.b__6(<>f__AnonymousType14 g) at Medallion.Collections.TopologicalSorter.TopologicalSort[TElement](ITopologicalSortProvider1 provider)+MoveNext()
at System.Collections.Generic.List1.AddRange(IEnumerable1 collection)
at System.Linq.Enumerable.ConcatIterator1.ToList() at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.SaveChangesAsync(DbContext context, BulkConfig bulkConfig, Action1 progress, Boolean isAsync, CancellationToken cancellationToken)
at EFCore.BulkExtensions.DbContextBulkTransactionSaveChanges.SaveChangesAsync(DbContext context, BulkConfig bulkConfig, Action1 progress, CancellationToken cancellationToken) at EFCore.BulkExtensions.DbContextBulkTransaction.ExecuteAsync[T](DbContext context, Type type, IEnumerable1 entities, OperationType operationType, BulkConfig bulkConfig, Action`1 progress, CancellationToken cancellationToken)
I looks like e is null here
Func<IEntityType, IEnumerable<IEntityType>> getFks = delegate(IEntityType e)
{
IEntityType e2 = e;
return from x in e2.GetForeignKeys()
where x.PrincipalEntityType != e2
select x.PrincipalEntityType;
};
coming from
var first = TopologicalSortExtensions.OrderTopologicallyBy(enumerable, g => getFks(g.EntityType).SelectMany((IEntityType x) => addedLookup[x]), null);
When analyzing g I see that the contains the following information:
I'm getting the following exception when calling dbContext.BulkSaveChanges():
I looks like e is null here
coming from
var first = TopologicalSortExtensions.OrderTopologicallyBy(enumerable, g => getFks(g.EntityType).SelectMany((IEntityType x) => addedLookup[x]), null);
When analyzing g I see that the contains the following information:
AddressEntity is an OwnsOne Relation type, so I guess that's the reason that there is no entity type?
I'm using version 8.0.1 and SQL Server.
The text was updated successfully, but these errors were encountered: