C# Class Hd.QueryExtensions.SqlExpression

Afficher le fichier Open project: TargetProcess/Tp.HelpDesk Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
SqlExpression ( ) : System

Method Details

Constant() public static méthode

Creates a SqlExpression which represents a constant typed value.
public static Constant ( SqlConstant val ) : SqlExpression
val SqlConstant SqlConstant instance
Résultat SqlExpression

Constant() public static méthode

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
Résultat SqlExpression

Date() public static méthode

Creates a SqlExpression which represents a date value.
public static Date ( System.DateTime val ) : SqlExpression
val System.DateTime Value of the expression
Résultat SqlExpression

Field() public static méthode

public static Field ( Enum fieldName ) : SqlExpression
fieldName System.Enum
Résultat SqlExpression

Field() public static méthode

public static Field ( Enum firstPart, Enum secondPart, FromTerm table ) : SqlExpression
firstPart System.Enum
secondPart System.Enum
table FromTerm
Résultat SqlExpression

Field() public static méthode

public static Field ( Enum fieldName, FromTerm table ) : SqlExpression
fieldName System.Enum
table FromTerm
Résultat SqlExpression

Field() public static méthode

Creates a SqlExpression which represents a field in a database table.
public static Field ( string fieldName ) : SqlExpression
fieldName string Name of a field
Résultat SqlExpression

Field() public static méthode

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
Résultat SqlExpression

Function() public static méthode

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
Résultat SqlExpression

IfNull() public static méthode

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
Résultat SqlExpression

LikeExpressionParameter() public static méthode

public static LikeExpressionParameter ( ) : SqlExpression
Résultat SqlExpression

LikeExpressionParameter() public static méthode

public static LikeExpressionParameter ( Enum paramName ) : SqlExpression
paramName System.Enum
Résultat SqlExpression

LikeExpressionParameter() public static méthode

public static LikeExpressionParameter ( string paramName ) : SqlExpression
paramName string
Résultat SqlExpression

Null() public static méthode

Creates a SqlExpression representing a NULL value
public static Null ( ) : SqlExpression
Résultat SqlExpression

Number() public static méthode

Creates a SqlExpression which represents a numeric value.
public static Number ( double val ) : SqlExpression
val double Value of the expression
Résultat SqlExpression

Number() public static méthode

Creates a SqlExpression which represents a numeric value.
public static Number ( int val ) : SqlExpression
val int Value of the expression
Résultat SqlExpression

Parameter() public static méthode

public static Parameter ( ) : SqlExpression
Résultat SqlExpression

Parameter() public static méthode

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
Résultat SqlExpression

PseudoField() public static méthode

public static PseudoField ( string fieldName ) : SqlExpression
fieldName string
Résultat SqlExpression

Raw() public static méthode

Creates a SqlExpression with raw SQL
public static Raw ( string sql ) : SqlExpression
sql string
Résultat SqlExpression

String() public static méthode

Creates a SqlExpression which represents a textual value.
public static String ( string val ) : SqlExpression
val string Value of the expression
Résultat SqlExpression

SubQuery() public static méthode

Creates a SqlExpression which represents a subquery.
public static SubQuery ( SelectQuery query ) : SqlExpression
query SelectQuery A SelectQuery object
Résultat SqlExpression

SubQuery() public static méthode

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.
Résultat SqlExpression