C# Class DbExpressions.DbQueryTranslatorFactory

Factory class that creates DbQueryTranslator instances.
Exibir arquivo Open project: seesharper/DbExpressions Class Usage Examples

Public Methods

Method 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

Method 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 method

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
return DbQueryTranslator

GetQueryTranslator() public static method

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

RegisterQueryTranslator() public static method

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.
return void

SetDefaultProvider() public static method

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
return void