Class PseudoFunctions
Contains names and create helpers for pseudo-functions, generated by linq2db and then converted to database-specific SQL by provider-specific SQL optimizer.
public static class PseudoFunctions
- Inheritance
-
PseudoFunctions
- Inherited Members
Fields
CONVERT_FORMAT
Function to convert value from one type to another: CONVERT(to_type, from_type, value) { CanBeNull = value.CanBeNull }
public const string CONVERT_FORMAT = "$Convert_Format$"
Field Value
LENGTH
Function for calculating length of string: LENGTH(value)
public const string LENGTH = "$Length$"
Field Value
MERGE_ACTION
public const string MERGE_ACTION = "$merge_action$"
Field Value
REMOVE_CONVERT
Function to suppress conversion SQL generation for provided value: REMOVE_CONVERT(value, resultType)
public const string REMOVE_CONVERT = "$Convert_Remover$"
Field Value
REPLACE
Function to replace one text fragment with another in string: REPLACE(value, oldSubstring, newSubstring)
public const string REPLACE = "$Replace$"
Field Value
TO_LOWER
Function to convert text parameter to lowercased form: TO_LOWER(string)
public const string TO_LOWER = "$ToLower$"
Field Value
TO_UPPER
Function to convert text parameter to uppercased form: TO_UPPER(string)
public const string TO_UPPER = "$ToUpper$"
Field Value
TRY_CONVERT
Function to convert value from one type to another: TRY_CONVERT(to_type, from_type, value) { CanBeNull = true }.
Returns NULL on conversion failure.
public const string TRY_CONVERT = "$TryConvert$"
Field Value
TRY_CONVERT_OR_DEFAULT
Function to convert value from one type to another: TRY_CONVERT_OR_DEFAULT(to_type, from_type, value, defaultValue) { CanBeNull = value.CanBeNull || defaultValue.CanBeNull }.
Returns provided default value on conversion failure.
public const string TRY_CONVERT_OR_DEFAULT = "$TryConvertOrDefault$"
Field Value
Methods
MakeCast(ISqlExpression, DbDataType, SqlDataType?)
Creates cast expression: CAST(value AS to_type)
public static SqlCastExpression MakeCast(ISqlExpression value, DbDataType toType, SqlDataType? fromType = null)
Parameters
valueISqlExpressiontoTypeDbDataTypefromTypeSqlDataType
Returns
MakeMandatoryCast(ISqlExpression, DbDataType, SqlDataType?)
Function to convert value from one type to another: CONVERT(to_type, from_type, value) { CanBeNull = value.CanBeNull, DoNotOptimize = true }
public static SqlCastExpression MakeMandatoryCast(ISqlExpression value, DbDataType toType, SqlDataType? fromType = null)
Parameters
valueISqlExpressiontoTypeDbDataTypefromTypeSqlDataType
Returns
MakeReplace(ISqlExpression, ISqlExpression, ISqlExpression, MappingSchema)
public static SqlFunction MakeReplace(ISqlExpression value, ISqlExpression oldSubstring, ISqlExpression newSubstring, MappingSchema mappingSchema)
Parameters
valueISqlExpressionoldSubstringISqlExpressionnewSubstringISqlExpressionmappingSchemaMappingSchema
Returns
MakeToLower(ISqlExpression, MappingSchema)
public static SqlFunction MakeToLower(ISqlExpression value, MappingSchema mappingSchema)
Parameters
valueISqlExpressionmappingSchemaMappingSchema