You've already forked linux-packaging-mono
Imported Upstream version 6.4.0.137
Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
parent
e9207cf623
commit
ef583813eb
@@ -35,9 +35,11 @@ namespace System.Data.Common {
|
||||
private static DataTable _providerTable;
|
||||
private static object _lockobj = new object();
|
||||
|
||||
static public DbProviderFactory GetFactory(string providerInvariantName) {
|
||||
ADP.CheckArgumentLength(providerInvariantName, "providerInvariantName");
|
||||
static public DbProviderFactory GetFactory(string providerInvariantName) => GetFactory(providerInvariantName, true);
|
||||
|
||||
static public DbProviderFactory GetFactory(string providerInvariantName, bool throwOnError) {
|
||||
if (throwOnError)
|
||||
ADP.CheckArgumentLength(providerInvariantName, "providerInvariantName");
|
||||
// NOTES: Include the Framework Providers and any other Providers listed in the config file.
|
||||
DataTable providerTable = GetProviderTable();
|
||||
if (null != providerTable) {
|
||||
@@ -54,7 +56,10 @@ namespace System.Data.Common {
|
||||
return DbProviderFactories.GetFactory(providerRow);
|
||||
}
|
||||
}
|
||||
throw ADP.ConfigProviderNotFound();
|
||||
|
||||
if (throwOnError)
|
||||
throw ADP.ConfigProviderNotFound();
|
||||
return null;
|
||||
}
|
||||
|
||||
static public DbProviderFactory GetFactory(DataRow providerRow) {
|
||||
@@ -258,6 +263,12 @@ namespace System.Data.Common {
|
||||
}
|
||||
|
||||
#if MONO
|
||||
public static bool TryGetFactory(string providerInvariantName, out DbProviderFactory factory)
|
||||
{
|
||||
factory = GetFactory(providerInvariantName, throwOnError: false);
|
||||
return factory != null;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetProviderInvariantNames()
|
||||
{
|
||||
return _registeredFactories.Keys.ToList();
|
||||
|
@@ -20,7 +20,7 @@ namespace System.Data {
|
||||
/// </para>
|
||||
/// </devdoc>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
[ Obsolete("DataSysDescriptionAttribute has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202", false) ]
|
||||
[Obsolete("DataSysDescriptionAttribute has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202", false) ]
|
||||
public class DataSysDescriptionAttribute : DescriptionAttribute {
|
||||
|
||||
private bool replaced = false;
|
||||
|
Reference in New Issue
Block a user