Remove performance optimisation tracking disables to keep things simple for now

This commit is contained in:
Dean Herbert 2018-05-30 13:43:43 +09:00
parent 4a7de043e0
commit eb89317494
1 changed files with 1 additions and 7 deletions

View File

@ -240,12 +240,8 @@ public TModel Import(ArchiveReader archive)
/// <param name="item">The item to delete.</param>
public void Delete(TModel item)
{
using (var usage = ContextFactory.GetForWrite())
using (ContextFactory.GetForWrite())
{
var context = usage.Context;
context.ChangeTracker.AutoDetectChangesEnabled = false;
// re-fetch the model on the import context.
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID);
@ -253,8 +249,6 @@ public void Delete(TModel item)
if (ModelStore.Delete(foundModel))
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
context.ChangeTracker.AutoDetectChangesEnabled = true;
}
}