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
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:
SaveChangesFailedandOptimisticConcurrencyExceptionfor same event efcore#30445 Removed SaveChangesFailed invocation when DbUpdateConcurrencyException is thrown (EF Core 8)The current documentation for the SaveChangesFailedAsync method states
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
ISaveChangesInterceptorcontract 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