DbConfiguration.SetProviderFactoryResolver Method (IDbProviderFactoryResolver)
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.
Assembly: EntityFramework (in EntityFramework.dll)
protected internal void SetProviderFactoryResolver( IDbProviderFactoryResolver providerFactoryResolver )
Parameters
- providerFactoryResolver
-
Type:
System.Data.Entity.Infrastructure.IDbProviderFactoryResolver
The provider factory service.
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.