private async Task <int> saveChangesAndUpdateParentScopeAsync(DetectModifiedEntitiesAndUpdateParentScope parentUpdater, CancellationToken cancellationToken = default(CancellationToken)) { var changes = await CurrentDbContextScope.SaveChangesAsync(cancellationToken); await parentUpdater.UpdateParentAsync(cancellationToken); return(changes); }
protected override int OnHandleSaveChanges(IInvocation invocation) { var dbContext = (DbContext)invocation.Proxy; var parentUpdater = new DetectModifiedEntitiesAndUpdateParentScope(dbContext, CurrentDbContextScope); var changes = CurrentDbContextScope.SaveChanges(); parentUpdater.UpdateParent(); return(changes); }
protected override void OnHandleDispose(IInvocation invocation) => CurrentDbContextScope.Dispose();