IExceptionDetector Interface

Definition

Used by EF internal code and database providers to detect various types of exceptions.

C#
public interface IExceptionDetector

Remarks

The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See Implementation of database providers and extensions for more information and examples.

Methods

IsCancellation(Exception, CancellationToken)

Returns whether the provided exception represents a cancellation event for the current provider.

Applies to

Product Versions
Entity Framework Core 7.0, 8.0, 9.0