Table of Contents

Class PseudoFunctions

Namespace
LinqToDB.SqlQuery
Assembly
linq2db.dll

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

Fields

COALESCE

Function to return first non-null argument: COALESCE(values...)

public const string COALESCE = "$Coalesce$"

Field Value

string

CONVERT

Function to convert value from one type to another: CONVERT(to_type, from_type, value) { CanBeNull = value.CanBeNull }

public const string CONVERT = "$Convert$"

Field Value

string

REMOVE_CONVERT

Function to suppress conversion SQL generation for provided value: REMOVE_CONVERT(value, resultType)

public const string REMOVE_CONVERT = "$Convert_Remover$"

Field Value

string

REPLACE

Function to replace one text fragment with another in string: REPLACE(value, oldSubstring, newSubstring)

public const string REPLACE = "$Replace$"

Field Value

string

TO_LOWER

Function to convert text parameter to lowercased form: TO_LOWER(string)

public const string TO_LOWER = "$ToLower$"

Field Value

string

TO_UPPER

Function to convert text parameter to uppercased form: TO_UPPER(string)

public const string TO_UPPER = "$ToUpper$"

Field Value

string

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

string

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

string

Methods

MakeCoalesce(Type, params ISqlExpression[])

public static SqlFunction MakeCoalesce(Type systemType, params ISqlExpression[] values)

Parameters

systemType Type
values ISqlExpression[]

Returns

SqlFunction

MakeConvert(SqlDataType, SqlDataType, ISqlExpression)

public static SqlFunction MakeConvert(SqlDataType toType, SqlDataType fromType, ISqlExpression value)

Parameters

toType SqlDataType
fromType SqlDataType
value ISqlExpression

Returns

SqlFunction

MakeRemoveConvert(ISqlExpression, SqlDataType)

public static SqlFunction MakeRemoveConvert(ISqlExpression value, SqlDataType resultType)

Parameters

value ISqlExpression
resultType SqlDataType

Returns

SqlFunction

MakeReplace(ISqlExpression, ISqlExpression, ISqlExpression)

public static SqlFunction MakeReplace(ISqlExpression value, ISqlExpression oldSubstring, ISqlExpression newSubstring)

Parameters

value ISqlExpression
oldSubstring ISqlExpression
newSubstring ISqlExpression

Returns

SqlFunction

MakeToLower(ISqlExpression)

public static SqlFunction MakeToLower(ISqlExpression value)

Parameters

value ISqlExpression

Returns

SqlFunction

MakeToUpper(ISqlExpression)

public static SqlFunction MakeToUpper(ISqlExpression value)

Parameters

value ISqlExpression

Returns

SqlFunction

MakeTryConvert(SqlDataType, SqlDataType, ISqlExpression)

public static SqlFunction MakeTryConvert(SqlDataType toType, SqlDataType fromType, ISqlExpression value)

Parameters

toType SqlDataType
fromType SqlDataType
value ISqlExpression

Returns

SqlFunction

MakeTryConvertOrDefault(SqlDataType, SqlDataType, ISqlExpression, ISqlExpression)

public static SqlFunction MakeTryConvertOrDefault(SqlDataType toType, SqlDataType fromType, ISqlExpression value, ISqlExpression defaultValue)

Parameters

toType SqlDataType
fromType SqlDataType
value ISqlExpression
defaultValue ISqlExpression

Returns

SqlFunction