Class InterceptorAggregator<TInterceptor>
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.dll
Abstract base class for implementations of the IInterceptorAggregator service.
public abstract class InterceptorAggregator<TInterceptor> : IInterceptorAggregator where TInterceptor : class, IInterceptor
Type Parameters
TInterceptor
The interceptor type.
- Inheritance
-
InterceptorAggregator<TInterceptor>
- Implements
- Derived
- Inherited Members
Remarks
The service lifetime is Scoped and multiple registrations are allowed. This means that each DbContext instance will use its own set of instances of this service. The implementations may depend on other services registered with any lifetime. The implementations do not need to be thread-safe.
See EF Core interceptors for more information and examples.
Constructors
InterceptorAggregator()
protected InterceptorAggregator()
Properties
InterceptorType
The interceptor type.
public virtual Type InterceptorType { get; }
Property Value
Methods
AggregateInterceptors(IReadOnlyList<IInterceptor>)
Resolves a single IInterceptor /> from all those registered on the DbContext or in the internal service provider.
public virtual IInterceptor? AggregateInterceptors(IReadOnlyList<IInterceptor> interceptors)
Parameters
interceptors
IReadOnlyList<IInterceptor>The interceptors to combine.
Returns
- IInterceptor
The combined interceptor.
CreateChain(IEnumerable<TInterceptor>)
Must be implemented by the inheriting type to create a single interceptor from the given list.
protected abstract TInterceptor CreateChain(IEnumerable<TInterceptor> interceptors)
Parameters
interceptors
IEnumerable<TInterceptor>The interceptors to combine.
Returns
- TInterceptor
The combined interceptor.