Delen via


DbConfigurationLoadedEventArgs.ReplaceService<TService> Method

Definition

Adds a wrapping resolver to the configuration that is about to be locked. A wrapping resolver is a resolver that incepts a service would have been returned by the resolver chain and wraps or replaces it with another service of the same type.

public void ReplaceService<TService> (Func<TService,object,TService> serviceInterceptor);
member this.ReplaceService : Func<'Service, obj, 'Service> -> unit
Public Sub ReplaceService(Of TService) (serviceInterceptor As Func(Of TService, Object, TService))

Type Parameters

TService

The type of service to wrap or replace.

Parameters

serviceInterceptor
Func<TService,Object,TService>

A delegate that takes the unwrapped service and key and returns the wrapped or replaced service.

Applies to