/// <summary> /// Called when an exception has been thrown in <see cref="M:DbContext.SaveChangesAsync"/>. /// </summary> /// <param name="eventData"> Contextual information about the failure. </param> /// <param name="cancellationToken"> The cancellation token. </param> /// <returns> A <see cref="Task" /> representing the asynchronous operation. </returns> public virtual Task SaveChangesFailedAsync( DbContextErrorEventData eventData, CancellationToken cancellationToken = default) => Task.CompletedTask;
/// <summary> /// Called when an exception has been thrown in <see cref="O:DbContext.SaveChanges" />. /// </summary> /// <param name="eventData">Contextual information about the failure.</param> public virtual void SaveChangesFailed(DbContextErrorEventData eventData) { }
/// <summary> /// Called when an exception has been thrown in <see cref="M:DbContext.SaveChangesAsync"/>. /// </summary> /// <param name="eventData"> Contextual information about the failure. </param> /// <param name="cancellationToken"> The cancellation token. </param> /// <returns> A <see cref="Task" /> representing the asynchronous operation. </returns> public virtual ValueTask SaveChangesFailedAsync( DbContextErrorEventData eventData, CancellationToken cancellationToken = default) => new ValueTask();