diff --git a/src/EFCore/DbContext.cs b/src/EFCore/DbContext.cs index 0a6f2216b44..dd0818bf857 100644 --- a/src/EFCore/DbContext.cs +++ b/src/EFCore/DbContext.cs @@ -639,8 +639,6 @@ public virtual int SaveChanges(bool acceptAllChangesOnSuccess) { EntityFrameworkEventSource.Log.OptimisticConcurrencyFailure(); - DbContextDependencies.UpdateLogger.SaveChangesFailed(this, exception); - SaveChangesFailed?.Invoke(this, new SaveChangesFailedEventArgs(acceptAllChangesOnSuccess, exception)); throw; @@ -786,8 +784,6 @@ public virtual async Task SaveChangesAsync( { EntityFrameworkEventSource.Log.OptimisticConcurrencyFailure(); - await DbContextDependencies.UpdateLogger.SaveChangesFailedAsync(this, exception, cancellationToken).ConfigureAwait(false); - SaveChangesFailed?.Invoke(this, new SaveChangesFailedEventArgs(acceptAllChangesOnSuccess, exception)); throw; diff --git a/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs b/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs index d4f20fcd1ab..ff75ab339ee 100644 --- a/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs +++ b/test/EFCore.Specification.Tests/SaveChangesInterceptionTestBase.cs @@ -337,7 +337,7 @@ public virtual async Task Intercept_SaveChanges_failed(bool async, bool inject, Assert.Equal(async, interceptor.AsyncCalled); Assert.NotEqual(async, interceptor.SyncCalled); Assert.NotEqual(interceptor.AsyncCalled, interceptor.SyncCalled); - Assert.True(interceptor.FailedCalled); + Assert.Equal(concurrencyError, !interceptor.FailedCalled); Assert.Same(context, interceptor.Context); Assert.Same(thrown, interceptor.Exception); diff --git a/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs index b917dd30a79..a716dc8880d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs @@ -57,7 +57,7 @@ public virtual async Task Intercept_concurrency_with_relational_specific_data(bo Assert.Equal(async, saveChangesInterceptor.AsyncCalled); Assert.NotEqual(async, saveChangesInterceptor.SyncCalled); Assert.NotEqual(saveChangesInterceptor.AsyncCalled, saveChangesInterceptor.SyncCalled); - Assert.True(saveChangesInterceptor.FailedCalled); + Assert.False(saveChangesInterceptor.FailedCalled); Assert.Same(context, saveChangesInterceptor.Context); Assert.Same(thrown, saveChangesInterceptor.Exception);