Прочетете на английски Редактиране

Споделяне чрез


DbProviderFactories.TryGetFactory(String, DbProviderFactory) Method

Definition

Attempts to get the DbProviderFactory registered under the specified invariant provider name.

C#
public static bool TryGetFactory(string providerInvariantName, out System.Data.Common.DbProviderFactory? factory);
C#
public static bool TryGetFactory(string providerInvariantName, out System.Data.Common.DbProviderFactory factory);

Parameters

providerInvariantName
String

The invariant provider name to look up.

factory
DbProviderFactory

When this method returns, contains the DbProviderFactory associated with the specified invariant provider name, if the name is found; otherwise, null. This parameter is passed uninitialized.

Returns

true if a provider is registered under the specified invariant provider name; otherwise, false.

Applies to

Продукт Версии
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1