Skip to content

Update ISaveChangesInterceptor documentation to reflect EF Core 7 & 8 changes #4999

Description

@zdenek-jelinek

Type of issue

Outdated article

Description

In EF Core 7 and 8, the semantics of SaveChanges error reporting to ISaveChangesInterceptor was changed in the following ways:

The current documentation for the SaveChangesFailedAsync method states

Called when an exception has been thrown in DbContext.SaveChangesAsync.

which is misleading given the above.

A consumer has no way to know about these behaviors without studying EF Core sources. The available SaveChangesInterceptor example also ignores the EF Core 7 & 8 changes to the interface and error reporting protocol, further supporting the notion that SaveChangesFailed observes all exceptions.

Please update the documentation so that it clearly states which event handler is called in which scenarios.

The SaveChangesInterceptor class documentation has the same issues but the code uses <inheritdoc> from the interface so that will probably get fixed automatically along the way.

Both of the aforementioned changes were breaking with respect to the ISaveChangesInterceptor contract and were not documented as far as I could find, but given that was more than 2 years ago, it probably does not really matter at this point.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.diagnostics.isavechangesinterceptor?view=efcore-9.0

Content source URL

https://github.com/dotnet/EntityFramework.ApiDocs/blob/live/dotnet/xml/Microsoft.EntityFrameworkCore.Diagnostics/ISaveChangesInterceptor.xml

Document Version Independent Id

e24069a7-444a-9846-27d8-8768f20411b0

Platform Id

70b472ba-8338-f916-d2ff-3e94790a4b37

Article author

@dotnet-bot

Activity

  1. changed the title [-]Update ISaveChangesInterceptor documentation to reflect EF Core 7 changes[/-] [+]Update ISaveChangesInterceptor documentation to reflect EF Core 7 & 8 changes[/+] on Apr 5, 2025
  2. added this to the 8.0.0 milestone on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions