DbConfigurationLoadedEventArgs.AddDependencyResolver Method (IDbDependencyResolver, Boolean)

 

Adds a IDbDependencyResolver instance to the Chain of Responsibility of resolvers that are used to resolve dependencies needed by the Entity Framework.

Namespace:   System.Data.Entity.Infrastructure.DependencyResolution
Assembly:  EntityFramework (in EntityFramework.dll)

public void AddDependencyResolver(
	IDbDependencyResolver resolver,
	bool overrideConfigFile
)

Parameters

resolver
Type: System.Data.Entity.Infrastructure.DependencyResolution.IDbDependencyResolver

The resolver to add.

overrideConfigFile
Type: System.Boolean

If true, then the resolver added will take precedence over settings in the config file.

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 only exception 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, unless the overrideConfigFile is set to true in which case the resolver added here will also override config file settings.