/// <summary> /// Call this method to add a <see cref="IDbDependencyResolver" /> instance to the Chain of Responsibility /// of resolvers that are used to resolve dependencies needed by the Entity Framework. Unlike the AddDependencyResolver /// method, this method puts the resolver at the bottom of the Chain of Responsibility such that it will only /// be used to resolve a dependency that could not be resolved by any of the other resolvers. /// </summary> /// <param name="resolver"> The resolver to add. </param> public void AddDefaultResolver(IDbDependencyResolver resolver) { Check.NotNull(resolver, "resolver"); _internalConfiguration.CheckNotLocked("AddDefaultResolver"); _internalConfiguration.AddDefaultResolver(resolver); }
private void RegisterDbProviderServices() { var providers = _appConfig.DbProviderServices; if (providers.All(p => p.InvariantName != "System.Data.SqlClient")) { // If no SQL Server provider is registered, then make sure the SQL Server provider is available // by convention (if it can be loaded) as it would have been in previous versions of EF. RegisterSqlServerProvider(); } providers.Each( p => { _providerFactories[p.InvariantName] = p.ProviderServices; _internalConfiguration.AddDefaultResolver(p.ProviderServices); }); }