C# Класс Hd.QueryExtensions.SqlExpression

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Constant ( SqlConstant val ) : SqlExpression

Creates a SqlExpression which represents a constant typed value.

Constant ( SqlDataType dataType, object val ) : SqlExpression

Creates a SqlExpression which represents a constant typed value

Date ( System.DateTime val ) : SqlExpression

Creates a SqlExpression which represents a date value.

Field ( Enum fieldName ) : SqlExpression
Field ( Enum firstPart, Enum secondPart, FromTerm table ) : SqlExpression
Field ( Enum fieldName, FromTerm table ) : SqlExpression
Field ( string fieldName ) : SqlExpression

Creates a SqlExpression which represents a field in a database table.

Field ( string fieldName, FromTerm table ) : SqlExpression

Creates a SqlExpression which represents a field in a database table.

Function ( SqlAggregationFunction func, SqlExpression param ) : SqlExpression

Creates a SqlExpression with an aggergation function

IfNull ( SqlExpression test, SqlExpression val ) : SqlExpression

Creates a SqlExpression with IfNull function.

Works as SQL Server's ISNULL() function.

LikeExpressionParameter ( ) : SqlExpression
LikeExpressionParameter ( Enum paramName ) : SqlExpression
LikeExpressionParameter ( string paramName ) : SqlExpression
Null ( ) : SqlExpression

Creates a SqlExpression representing a NULL value

Number ( double val ) : SqlExpression

Creates a SqlExpression which represents a numeric value.

Number ( int val ) : SqlExpression

Creates a SqlExpression which represents a numeric value.

Parameter ( ) : SqlExpression
Parameter ( string paramName ) : SqlExpression Correct parameter name depends on your specifc data provider. OLEDB expects all parameters to be '?' and matches parameters to values based on their index. SQL Server Native driver matches parameters by names and expects to find "@paramName" parameter placeholder in the query.
PseudoField ( string fieldName ) : SqlExpression
Raw ( string sql ) : SqlExpression

Creates a SqlExpression with raw SQL

String ( string val ) : SqlExpression

Creates a SqlExpression which represents a textual value.

SubQuery ( SelectQuery query ) : SqlExpression

Creates a SqlExpression which represents a subquery.

SubQuery ( string queryText ) : SqlExpression

Creates a SqlExpression which represents a subquery.

In many cases you can use an inner or outer JOIN instead of a subquery. If you prefer using subqueries it is recomended that you construct the subquery using another instance of SelectQuery, render it using the correct renderer and pass the resulting SQL statement to the queryText parameter.

Приватные методы

Метод Описание
SqlExpression ( ) : System

Описание методов

Constant() публичный статический Метод

Creates a SqlExpression which represents a constant typed value.
public static Constant ( SqlConstant val ) : SqlExpression
val SqlConstant SqlConstant instance
Результат SqlExpression

Constant() публичный статический Метод

Creates a SqlExpression which represents a constant typed value
public static Constant ( SqlDataType dataType, object val ) : SqlExpression
dataType SqlDataType Value's data type
val object The value
Результат SqlExpression

Date() публичный статический Метод

Creates a SqlExpression which represents a date value.
public static Date ( System.DateTime val ) : SqlExpression
val System.DateTime Value of the expression
Результат SqlExpression

Field() публичный статический Метод

public static Field ( Enum fieldName ) : SqlExpression
fieldName System.Enum
Результат SqlExpression

Field() публичный статический Метод

public static Field ( Enum firstPart, Enum secondPart, FromTerm table ) : SqlExpression
firstPart System.Enum
secondPart System.Enum
table FromTerm
Результат SqlExpression

Field() публичный статический Метод

public static Field ( Enum fieldName, FromTerm table ) : SqlExpression
fieldName System.Enum
table FromTerm
Результат SqlExpression

Field() публичный статический Метод

Creates a SqlExpression which represents a field in a database table.
public static Field ( string fieldName ) : SqlExpression
fieldName string Name of a field
Результат SqlExpression

Field() публичный статический Метод

Creates a SqlExpression which represents a field in a database table.
public static Field ( string fieldName, FromTerm table ) : SqlExpression
fieldName string Name of a field
table FromTerm The table this field belongs to
Результат SqlExpression

Function() публичный статический Метод

Creates a SqlExpression with an aggergation function
public static Function ( SqlAggregationFunction func, SqlExpression param ) : SqlExpression
func SqlAggregationFunction Aggregation function to be applied on the supplied expression
param SqlExpression Parameter of the aggregation function
Результат SqlExpression

IfNull() публичный статический Метод

Creates a SqlExpression with IfNull function.
Works as SQL Server's ISNULL() function.
public static IfNull ( SqlExpression test, SqlExpression val ) : SqlExpression
test SqlExpression Expression to be checked for being NULL
val SqlExpression Substitution
Результат SqlExpression

LikeExpressionParameter() публичный статический Метод

public static LikeExpressionParameter ( ) : SqlExpression
Результат SqlExpression

LikeExpressionParameter() публичный статический Метод

public static LikeExpressionParameter ( Enum paramName ) : SqlExpression
paramName System.Enum
Результат SqlExpression

LikeExpressionParameter() публичный статический Метод

public static LikeExpressionParameter ( string paramName ) : SqlExpression
paramName string
Результат SqlExpression

Null() публичный статический Метод

Creates a SqlExpression representing a NULL value
public static Null ( ) : SqlExpression
Результат SqlExpression

Number() публичный статический Метод

Creates a SqlExpression which represents a numeric value.
public static Number ( double val ) : SqlExpression
val double Value of the expression
Результат SqlExpression

Number() публичный статический Метод

Creates a SqlExpression which represents a numeric value.
public static Number ( int val ) : SqlExpression
val int Value of the expression
Результат SqlExpression

Parameter() публичный статический Метод

public static Parameter ( ) : SqlExpression
Результат SqlExpression

Parameter() публичный статический Метод

Correct parameter name depends on your specifc data provider. OLEDB expects all parameters to be '?' and matches parameters to values based on their index. SQL Server Native driver matches parameters by names and expects to find "@paramName" parameter placeholder in the query.
public static Parameter ( string paramName ) : SqlExpression
paramName string
Результат SqlExpression

PseudoField() публичный статический Метод

public static PseudoField ( string fieldName ) : SqlExpression
fieldName string
Результат SqlExpression

Raw() публичный статический Метод

Creates a SqlExpression with raw SQL
public static Raw ( string sql ) : SqlExpression
sql string
Результат SqlExpression

String() публичный статический Метод

Creates a SqlExpression which represents a textual value.
public static String ( string val ) : SqlExpression
val string Value of the expression
Результат SqlExpression

SubQuery() публичный статический Метод

Creates a SqlExpression which represents a subquery.
public static SubQuery ( SelectQuery query ) : SqlExpression
query SelectQuery A SelectQuery object
Результат SqlExpression

SubQuery() публичный статический Метод

Creates a SqlExpression which represents a subquery.
In many cases you can use an inner or outer JOIN instead of a subquery. If you prefer using subqueries it is recomended that you construct the subquery using another instance of SelectQuery, render it using the correct renderer and pass the resulting SQL statement to the queryText parameter.
public static SubQuery ( string queryText ) : SqlExpression
queryText string Text of the subquery.
Результат SqlExpression