Share via


DbConfiguration.AddDependencyResolver(IDbDependencyResolver) Method

Definition

Call this method from the constructor of a class derived from DbConfiguration to add a IDbDependencyResolver instance to the Chain of Responsibility of resolvers that are used to resolve dependencies needed by the Entity Framework.

protected internal void AddDependencyResolver (System.Data.Entity.Infrastructure.DependencyResolution.IDbDependencyResolver resolver);
member this.AddDependencyResolver : System.Data.Entity.Infrastructure.DependencyResolution.IDbDependencyResolver -> unit
Protected Friend Sub AddDependencyResolver (resolver As IDbDependencyResolver)

Parameters

resolver
IDbDependencyResolver

The resolver to add.

Remarks

Resolvers are asked to resolve dependencies in reverse order from which they are added. This means that a resolver can be added to override resolution of a dependency that would already have been resolved in a different way. The exceptions to this is that any dependency registered in the application's config file will always be used in preference to using a dependency resolver added here.

Applies to