/// <summary> /// Saves the changes made by the client. /// </summary> /// <param name="workState">The save work state.</param> /// <param name="context">The save context.</param> /// <param name="saveChangesOptions">The save options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The save result.</returns> protected virtual async Task <SaveResult> SaveChangesCoreAsync(SaveWorkState workState, SaveChangesContext context, AsyncSaveChangesOptions saveChangesOptions, CancellationToken cancellationToken) { workState.KeyMappings = await _entityUpdater.FetchAndApplyChangesAsync(this, context, saveChangesOptions, cancellationToken).ConfigureAwait(false); return(workState.ToSaveResult()); }
/// <summary> /// Handles an exception thrown while saving entities. /// </summary> /// <param name="exception">The thrown exception.</param> /// <param name="saveWorkState">The save work state.</param> /// <returns>Whether the exception was handled.</returns> protected virtual bool HandleSaveException(Exception exception, SaveWorkState saveWorkState) { return(false); }
/// <summary> /// Saves the changes made by the client. /// </summary> /// <param name="workState">The save work state.</param> /// <param name="context">The save context.</param> /// <param name="saveChangesOptions">The save options.</param> /// <returns>The save result.</returns> protected virtual SaveResult SaveChangesCore(SaveWorkState workState, SaveChangesContext context, SaveChangesOptions saveChangesOptions) { workState.KeyMappings = _entityUpdater.FetchAndApplyChanges(this, context, saveChangesOptions); return(workState.ToSaveResult()); }