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
using (var transaction = _db.Database.BeginTransaction())
{
_db.BulkInsert(headerstoInsert, new BulkConfig { SetOutputIdentity = true });
var subEntities = new List<BillingDetail>();
foreach (var entity in headerstoInsert)
{
foreach (var subEntity in entity.BillingDetails)
{
subEntity.BillingId = entity.BillingId; // sets FK to match its linked PK that was generated in DB
}
subEntities.AddRange(entity.BillingDetails);
}
_db.BulkInsert(subEntities);
transaction.Commit();
}
});`
The text was updated successfully, but these errors were encountered:
Can you write full code snippet or entire test the for reproduction of the issue, so Entity class, and context config if any.
Try yo strip ti to minimum components that still throws the exception.
Using version 8.0.1. I get this error when saving sub entities. The FK is a long. I'm wondering that has anything to do with it?
It fails at the bulk insert subEntities line with this error:
` executionStrategy.Execute(
() =>
{
//_db.BillingHeaders.AddRange(headerstoInsert);
//_db.BulkSaveChanges();
The text was updated successfully, but these errors were encountered: