DbConfiguration.SetProviderFactoryResolver(IDbProviderFactoryResolver) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Call this method from the constructor of a class derived from DbConfiguration to set an implementation of IDbProviderFactoryResolver which allows a DbProviderFactory to be obtained from a DbConnection in cases where the default implementation is not sufficient.
protected internal void SetProviderFactoryResolver (System.Data.Entity.Infrastructure.IDbProviderFactoryResolver providerFactoryResolver);
member this.SetProviderFactoryResolver : System.Data.Entity.Infrastructure.IDbProviderFactoryResolver -> unit
Protected Friend Sub SetProviderFactoryResolver (providerFactoryResolver As IDbProviderFactoryResolver)
Parameters
- providerFactoryResolver
- IDbProviderFactoryResolver
The provider factory service.
Remarks
This method is provided as a convenient and discoverable way to add configuration to the Entity Framework. Internally it works in the same way as using AddDependencyResolver to add an appropriate resolver for IDbProviderFactoryResolver. This means that, if desired, the same functionality can be achieved using a custom resolver or a resolver backed by an Inversion-of-Control container.
Applies to
Entity Framework