ISaveChangesInterceptor.SavingChanges Method

Definition

Called at the start of DbContext.SaveChanges.

C#
public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> SavingChanges (Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result);
C#
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> SavingChanges (Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result);

Parameters

eventData
DbContextEventData

Contextual information about the DbContext being used.

result
InterceptionResult<Int32>

Represents the current result if one exists. This value will have HasResult set to true if some previous interceptor suppressed execution by calling SuppressWithResult(TResult). This value is typically used as the return value for the implementation of this method.

Returns

If HasResult is false, the EF will continue as normal. If HasResult is true, then EF will suppress the operation it was about to perform and use Result instead. An implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in.

Applies to

Toode Versioonid
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0