/// <summary> /// 初始化 <see cref="DbProviderFactory"/> 对象。 /// </summary> /// <returns></returns> protected override DbProviderFactory InitDbProviderFactory() { foreach (var typeName in typeNames) { if (AssemblyLoader.TryLoad(typeName, out DbProviderFactory factory)) { return(factory); } } return(null); }
public DbProviderFactory Resolve() { foreach (var typeName in _typeNames) { if (AssemblyLoader.TryLoad(typeName, out DbProviderFactory factory)) { return(factory); } } Exception = new FileNotFoundException(SR.GetString(SRKind.InstallProviderAssembly, string.Join("、", _typeNames.Select(s => s.Substring(s.LastIndexOf(",") + 1).Trim() + ".dll").ToArray()))); return(null); }