DatabaseProviderRegistry

Ecng.Data

Provides a registry of known database provider names and their factories.

Propriedades

AllProviders
public static string[] AllProviders { get; }
value = DatabaseProviderRegistry.AllProviders

Gets the list of all registered database providers.

Métodos

GetDialect
public static ISqlDialect GetDialect(string providerName)
result = DatabaseProviderRegistry.GetDialect(providerName)

Gets the SQL dialect for a provider.

providerName
Provider name.

Retorna: SQL dialect instance.

GetFactory
public static DbProviderFactory GetFactory(string providerName)
result = DatabaseProviderRegistry.GetFactory(providerName)

Gets the registered provider factory by name.

providerName
Provider name.

Retorna: Provider factory instance.

IsRegistered
public static bool IsRegistered(string providerName)
result = DatabaseProviderRegistry.IsRegistered(providerName)

Checks if a provider is registered.

providerName
Provider name.

Retorna: true if the provider is registered; otherwise, false.

Register
public static void Register(string providerName, DbProviderFactory factory)
DatabaseProviderRegistry.Register(providerName, factory)

Registers a database provider factory.

providerName
Provider name.
factory
Provider factory instance.
RegisterDialect
public static void RegisterDialect(string providerName, ISqlDialect dialect)
DatabaseProviderRegistry.RegisterDialect(providerName, dialect)

Registers a SQL dialect for a provider.

providerName
Provider name.
dialect
SQL dialect instance.
TryGetDialect
public static bool TryGetDialect(string providerName, ISqlDialect dialect)
result = DatabaseProviderRegistry.TryGetDialect(providerName, dialect)

Tries to get the SQL dialect for a provider.

providerName
Provider name.
dialect
SQL dialect instance if found.

Retorna: true if the dialect was found; otherwise, false.

TryGetFactory
public static bool TryGetFactory(string providerName, DbProviderFactory factory)
result = DatabaseProviderRegistry.TryGetFactory(providerName, factory)

Tries to get the registered provider factory by name.

providerName
Provider name.
factory
Provider factory instance if found.

Retorna: true if the provider was found; otherwise, false.

Unregister
public static bool Unregister(string providerName)
result = DatabaseProviderRegistry.Unregister(providerName)

Unregisters a database provider factory.

providerName
Provider name.

Retorna: true if the provider was removed; otherwise, false.

Campos

MySql
public const string MySql
value = DatabaseProviderRegistry.MySql

MySQL provider name.

PostgreSql
public const string PostgreSql
value = DatabaseProviderRegistry.PostgreSql

PostgreSQL provider name.

SQLite
public const string SQLite
value = DatabaseProviderRegistry.SQLite

SQLite provider name.

SqlServer
public const string SqlServer
value = DatabaseProviderRegistry.SqlServer

SQL Server provider name.