C# Class DbExpressions.DbQueryTranslatorFactory

Factory class that creates DbQueryTranslator instances.
Afficher le fichier Open project: seesharper/DbExpressions Class Usage Examples

Méthodes publiques

Méthode Description
GetQueryTranslator ( ) : DbQueryTranslator

Gets a new DbQueryTranslator instance according to the configured default provider name.

The default value is "System.Data.SqlClient", but this can be overridden in app/web.config. The default provider is also used to translate an expression in the DbExpression.ToString method.

GetQueryTranslator ( string invariantProviderName ) : DbQueryTranslator

Gets a new DbQueryTranslator instance.

RegisterQueryTranslator ( string providerInvariantName, Type queryTranslatorType ) : void

Registers a new DbQueryTranslator type for the target provider.

SetDefaultProvider ( string providerInvariantName ) : void

Specifies the name of the default provider that will be used if otherwise not specified. This will also be used in the ToString() override to provide a textual representation of the query during debugging.

Private Methods

Méthode Description
CreateInstance ( string providerInvariantName, Type type ) : DbQueryTranslator
CreateProviderFactory ( string providerInvariantName ) : System.Data.Common.DbProviderFactory
DbQueryTranslatorFactory ( ) : System
RegisterBuiltinTranslators ( ) : void
RegisterConfiguredTranslators ( ) : void

Method Details

GetQueryTranslator() public static méthode

Gets a new DbQueryTranslator instance according to the configured default provider name.
The default value is "System.Data.SqlClient", but this can be overridden in app/web.config. The default provider is also used to translate an expression in the DbExpression.ToString method.
public static GetQueryTranslator ( ) : DbQueryTranslator
Résultat DbQueryTranslator

GetQueryTranslator() public static méthode

Gets a new DbQueryTranslator instance.
public static GetQueryTranslator ( string invariantProviderName ) : DbQueryTranslator
invariantProviderName string The invariant provider name.
Résultat DbQueryTranslator

RegisterQueryTranslator() public static méthode

Registers a new DbQueryTranslator type for the target provider.
public static RegisterQueryTranslator ( string providerInvariantName, Type queryTranslatorType ) : void
providerInvariantName string The invarient name of the provider.
queryTranslatorType System.Type The concrete implementation of that targets this provider.
Résultat void

SetDefaultProvider() public static méthode

Specifies the name of the default provider that will be used if otherwise not specified. This will also be used in the ToString() override to provide a textual representation of the query during debugging.
public static SetDefaultProvider ( string providerInvariantName ) : void
providerInvariantName string
Résultat void