Change CascadeDeleteTiming and DeleteOrphansTiming in AbpDbContext constructor.

pull/2971/head
maliming 5 years ago
parent d98c393e99
commit b23428eee0

@ -81,6 +81,9 @@ namespace Volo.Abp.EntityFrameworkCore
protected AbpDbContext(DbContextOptions<TDbContext> options)
: base(options)
{
ChangeTracker.CascadeDeleteTiming = CascadeTiming.OnSaveChanges;
ChangeTracker.DeleteOrphansTiming = CascadeTiming.OnSaveChanges;
GuidGenerator = SimpleGuidGenerator.Instance;
EntityChangeEventHelper = NullEntityChangeEventHelper.Instance;
EntityHistoryHelper = NullEntityHistoryHelper.Instance;

@ -61,8 +61,6 @@ namespace Volo.Abp.Uow.EntityFrameworkCore
dbContext.Database.SetCommandTimeout(unitOfWork.Options.Timeout.Value.TotalSeconds.To<int>());
}
dbContext.ChangeTracker.CascadeDeleteTiming = CascadeTiming.OnSaveChanges;
dbContext.ChangeTracker.DeleteOrphansTiming = CascadeTiming.OnSaveChanges;
return dbContext;
}
}

Loading…
Cancel
Save