C# Class Tiraggo.DynamicQuery.tgQueryItem

显示文件 Open project: BrewDawg/Tiraggo Class Usage Examples

Public Methods

Method Description
As ( string alias ) : tgQueryItem

Privides the Ability to Alias a column name

Avg ( ) : tgQueryItem

Aggregate Avg. See tgQuerySubOperatorType Enumeration.

Between ( object start, object end ) : tgComparison

Comparison ensuring that this column is BETWEEN two values. See tgComparisonOperand Enumeration.

Case ( ) : tgCase
Cast ( tgCastType castType ) : tgQueryItem

Cast informs the DataProviders that a SQL CAST operation is needed.

In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age

Cast ( tgCastType castType, int length ) : tgQueryItem

Cast informs the DataProviders that a SQL CAST operation is needed. This overloaded version of Cast is useful for Casting variable length character columns

In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age

Cast ( tgCastType castType, int precision, int scale ) : tgQueryItem

Cast informs the DataProviders that a SQL CAST operation is needed. This overloaded version of Cast is useful for Casting decimal types

In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age

Coalesce ( string expresssions ) : tgQueryItem

This can be used to return the first non null parameter.

The code below will return "Smith" is the LastName column in the database is null. MyCollection coll = new MyCollection(); coll.Query.Select(coll.Query.LastName.Coalesce("'Smith'")); coll.Query.Load();

Contains ( object value ) : tgComparison

Contains is used to search columns containing character-based data types for precise or fuzzy (less precise) matches to single words and phrases. The column must have a Full Text index.

See CONTAINS in the SQL server MSDN docs for a full explanation of supported search terms and how to enable Full Text searching at the database, table, and column levels.

Count ( ) : tgQueryItem

Aggregate Count. See tgQuerySubOperatorType Enumeration.

Date ( ) : tgQueryItem

Returns the Date only portion of a date columm

DatePart ( string datePart ) : tgQueryItem

Returns a particular date part of a date column

Distinct ( ) : tgQueryItem

Set to true for (DISTINCT columnName).

GetHashCode ( ) : int

Required due to operator overloading.

In ( ) : tgComparison

Comparison ensuring that this column is IN a list of values. See tgComparisonOperand Enumeration.

In ( tgDynamicQuerySerializable subQuery ) : tgComparison

Comparison ensuring that this column is IN a list of values.

IsNotNull ( ) : tgComparison

Comparison ensuring that this column is NOT NULL. See tgComparisonOperand Enumeration.

IsNull ( ) : tgComparison

Comparison ensuring that this column is NULL. See tgComparisonOperand Enumeration.

LTrim ( ) : tgQueryItem

Performs a Left Trim (remove blanks) on the column

Length ( ) : tgQueryItem

Returns the length of a character based column

Like ( object value ) : tgComparison

Comparison ensuring that the value passed in is LIKE this column. See tgComparisonOperand Enumeration.

Like ( object value, char escapeCharacter ) : tgComparison

Comparison ensuring that the value passed in is LIKE this column. This overload takes a single escape character. See tgComparisonOperand Enumeration.

Max ( ) : tgQueryItem

Aggregate Max. See tgQuerySubOperatorType Enumeration.

Min ( ) : tgQueryItem

Aggregate Min. See tgQuerySubOperatorType Enumeration.

NotIn ( ) : tgComparison

Comparison ensuring that this column is NOT IN a list of values. See tgComparisonOperand Enumeration.

NotIn ( tgDynamicQuerySerializable subQuery ) : tgComparison

Comparison ensuring that this column is NOT IN a list of values.

NotLike ( object value ) : tgComparison

Comparison ensuring that the value passed in is NOT LIKE this column. See tgComparisonOperand Enumeration.

NotLike ( object value, char escapeCharacter ) : tgComparison

Comparison ensuring that the value passed in is NOT LIKE this column. This overload takes a single escape character. See tgComparisonOperand Enumeration.

OP ( tgComparisonOperand op ) : tgComparison

Where parameter operand creation is called by DynamicQuery. See tgComparisonOperand Enumeration.

OP ( tgComparisonOperand op, object value ) : tgComparison

Where parameter operand creation is called by DynamicQuery. See tgComparisonOperand Enumeration.

OP ( tgComparisonOperand op, object value1, object value2 ) : tgComparison

Where parameter operand creation is called by DynamicQuery. See tgComparisonOperand Enumeration.

RTrim ( ) : tgQueryItem

Performs a Right Trim (remove blanks) on the column

Round ( int significantDigits ) : tgQueryItem

Performs a round on the column

StdDev ( ) : tgQueryItem

Aggregate StdDev. See tgQuerySubOperatorType Enumeration.

Substring ( System length ) : tgQueryItem

Returns a portion of the string column

Substring ( System start, System length ) : tgQueryItem

Returns a portion of the string column

Substring ( int length ) : tgQueryItem

Returns a portion of the string column

Substring ( int start, int length ) : tgQueryItem

Returns a portion of the string column

Sum ( ) : tgQueryItem

Aggregate Sum. See tgQuerySubOperatorType Enumeration.

ToLower ( ) : tgQueryItem

Returns the column in LOWER CASE

ToString ( ) : string

ToString() (to use in GroupBy/OrderBy and such ....)

ToUpper ( ) : tgQueryItem

Returns the column in UPPER CASE

Trim ( ) : tgQueryItem

Removes blanks from the beginning and end of the column

Var ( ) : tgQueryItem

Aggregate Var. See tgQuerySubOperatorType Enumeration.

operator ( ) : tgComparison
operator ( ) : tgQueryItem
tgQueryItem ( tgDynamicQuerySerializable query, string columnName, tgSystemType datatype ) : System

The tgQueryItem class is dynamically created by your BusinessEntity's DynamicQuery mechanism.

Private Methods

Method Description
AddOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgQueryItem
AddSubOperator ( tgQuerySubOperator subOperator ) : void
CreateComparisonParameter ( tgComparisonOperand operand ) : tgComparison
CreateComparisonParameter ( tgComparisonOperand operand, object value ) : tgComparison
DivideOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgQueryItem
Equal ( object value ) : tgComparison
EqualOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgComparison
Equals ( object o ) : bool
GreaterThan ( object value ) : tgComparison
GreaterThan ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgComparison
GreaterThanOrEqual ( object value ) : tgComparison
GreaterThanOrEqual ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgComparison
LessThan ( object value ) : tgComparison
LessThan ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgComparison
LessThanOrEqual ( object value ) : tgComparison
LessThanOrEqual ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgComparison
ModuloOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgQueryItem
MultiplyOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgQueryItem
NotEqual ( object value ) : tgComparison
NotEqualOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgComparison
SubtractOperator ( tgQueryItem queryItem, object literal, tgSystemType literalType, bool itemFirst ) : tgQueryItem
tgQueryItem ( ) : System

Method Details

As() public method

Privides the Ability to Alias a column name
public As ( string alias ) : tgQueryItem
alias string The Alias Name
return tgQueryItem

Avg() public method

Aggregate Avg. See tgQuerySubOperatorType Enumeration.
public Avg ( ) : tgQueryItem
return tgQueryItem

Between() public method

Comparison ensuring that this column is BETWEEN two values. See tgComparisonOperand Enumeration.
public Between ( object start, object end ) : tgComparison
start object The starting value for comparison.
end object The ending value for comparison.
return tgComparison

Case() public method

public Case ( ) : tgCase
return tgCase

Cast() public method

Cast informs the DataProviders that a SQL CAST operation is needed.
In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age
public Cast ( tgCastType castType ) : tgQueryItem
castType tgCastType The type of cast needed
return tgQueryItem

Cast() public method

Cast informs the DataProviders that a SQL CAST operation is needed. This overloaded version of Cast is useful for Casting variable length character columns
In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age
public Cast ( tgCastType castType, int length ) : tgQueryItem
castType tgCastType The type of cast needed
length int
return tgQueryItem

Cast() public method

Cast informs the DataProviders that a SQL CAST operation is needed. This overloaded version of Cast is useful for Casting decimal types
In C# you can cast with the overloaded cast operators, like this: (tgString)query.Age
public Cast ( tgCastType castType, int precision, int scale ) : tgQueryItem
castType tgCastType The type of cast needed
precision int
scale int
return tgQueryItem

Coalesce() public method

This can be used to return the first non null parameter.
The code below will return "Smith" is the LastName column in the database is null. MyCollection coll = new MyCollection(); coll.Query.Select(coll.Query.LastName.Coalesce("'Smith'")); coll.Query.Load();
public Coalesce ( string expresssions ) : tgQueryItem
expresssions string The value to return if null
return tgQueryItem

Contains() public method

Contains is used to search columns containing character-based data types for precise or fuzzy (less precise) matches to single words and phrases. The column must have a Full Text index.
See CONTAINS in the SQL server MSDN docs for a full explanation of supported search terms and how to enable Full Text searching at the database, table, and column levels.
public Contains ( object value ) : tgComparison
value object The value for comparison.
return tgComparison

Count() public method

Aggregate Count. See tgQuerySubOperatorType Enumeration.
public Count ( ) : tgQueryItem
return tgQueryItem

Date() public method

Returns the Date only portion of a date columm
public Date ( ) : tgQueryItem
return tgQueryItem

DatePart() public method

Returns a particular date part of a date column
public DatePart ( string datePart ) : tgQueryItem
datePart string
return tgQueryItem

Distinct() public method

Set to true for (DISTINCT columnName).
public Distinct ( ) : tgQueryItem
return tgQueryItem

GetHashCode() public method

Required due to operator overloading.
public GetHashCode ( ) : int
return int

In() public method

Comparison ensuring that this column is IN a list of values. See tgComparisonOperand Enumeration.
public In ( ) : tgComparison
return tgComparison

In() public method

Comparison ensuring that this column is IN a list of values.
public In ( tgDynamicQuerySerializable subQuery ) : tgComparison
subQuery tgDynamicQuerySerializable
return tgComparison

IsNotNull() public method

Comparison ensuring that this column is NOT NULL. See tgComparisonOperand Enumeration.
public IsNotNull ( ) : tgComparison
return tgComparison

IsNull() public method

Comparison ensuring that this column is NULL. See tgComparisonOperand Enumeration.
public IsNull ( ) : tgComparison
return tgComparison

LTrim() public method

Performs a Left Trim (remove blanks) on the column
public LTrim ( ) : tgQueryItem
return tgQueryItem

Length() public method

Returns the length of a character based column
public Length ( ) : tgQueryItem
return tgQueryItem

Like() public method

Comparison ensuring that the value passed in is LIKE this column. See tgComparisonOperand Enumeration.
public Like ( object value ) : tgComparison
value object The value for comparison.
return tgComparison

Like() public method

Comparison ensuring that the value passed in is LIKE this column. This overload takes a single escape character. See tgComparisonOperand Enumeration.
public Like ( object value, char escapeCharacter ) : tgComparison
value object The value for comparison.
escapeCharacter char The single escape character.
return tgComparison

Max() public method

Aggregate Max. See tgQuerySubOperatorType Enumeration.
public Max ( ) : tgQueryItem
return tgQueryItem

Min() public method

Aggregate Min. See tgQuerySubOperatorType Enumeration.
public Min ( ) : tgQueryItem
return tgQueryItem

NotIn() public method

Comparison ensuring that this column is NOT IN a list of values. See tgComparisonOperand Enumeration.
public NotIn ( ) : tgComparison
return tgComparison

NotIn() public method

Comparison ensuring that this column is NOT IN a list of values.
public NotIn ( tgDynamicQuerySerializable subQuery ) : tgComparison
subQuery tgDynamicQuerySerializable
return tgComparison

NotLike() public method

Comparison ensuring that the value passed in is NOT LIKE this column. See tgComparisonOperand Enumeration.
public NotLike ( object value ) : tgComparison
value object The value for comparison.
return tgComparison

NotLike() public method

Comparison ensuring that the value passed in is NOT LIKE this column. This overload takes a single escape character. See tgComparisonOperand Enumeration.
public NotLike ( object value, char escapeCharacter ) : tgComparison
value object The value for comparison.
escapeCharacter char The single escape character.
return tgComparison

OP() public method

Where parameter operand creation is called by DynamicQuery. See tgComparisonOperand Enumeration.
public OP ( tgComparisonOperand op ) : tgComparison
op tgComparisonOperand E.g., tgComparisonOperand.IsNotNull
return tgComparison

OP() public method

Where parameter operand creation is called by DynamicQuery. See tgComparisonOperand Enumeration.
public OP ( tgComparisonOperand op, object value ) : tgComparison
op tgComparisonOperand E.g., tgComparisonOperand.IsNotNull
value object The value for this comparison
return tgComparison

OP() public method

Where parameter operand creation is called by DynamicQuery. See tgComparisonOperand Enumeration.
public OP ( tgComparisonOperand op, object value1, object value2 ) : tgComparison
op tgComparisonOperand E.g., tgComparisonOperand.Between
value1 object The first value for this comparison
value2 object The second value for this comparison
return tgComparison

RTrim() public method

Performs a Right Trim (remove blanks) on the column
public RTrim ( ) : tgQueryItem
return tgQueryItem

Round() public method

Performs a round on the column
public Round ( int significantDigits ) : tgQueryItem
significantDigits int Round to the number of significant digits
return tgQueryItem

StdDev() public method

Aggregate StdDev. See tgQuerySubOperatorType Enumeration.
public StdDev ( ) : tgQueryItem
return tgQueryItem

Substring() public method

Returns a portion of the string column
public Substring ( System length ) : tgQueryItem
length System How many characters to return
return tgQueryItem

Substring() public method

Returns a portion of the string column
public Substring ( System start, System length ) : tgQueryItem
start System The starting character
length System How many characters to return
return tgQueryItem

Substring() public method

Returns a portion of the string column
public Substring ( int length ) : tgQueryItem
length int How many characters to return
return tgQueryItem

Substring() public method

Returns a portion of the string column
public Substring ( int start, int length ) : tgQueryItem
start int The starting character
length int How many characters to return
return tgQueryItem

Sum() public method

Aggregate Sum. See tgQuerySubOperatorType Enumeration.
public Sum ( ) : tgQueryItem
return tgQueryItem

ToLower() public method

Returns the column in LOWER CASE
public ToLower ( ) : tgQueryItem
return tgQueryItem

ToString() public method

ToString() (to use in GroupBy/OrderBy and such ....)
public ToString ( ) : string
return string

ToUpper() public method

Returns the column in UPPER CASE
public ToUpper ( ) : tgQueryItem
return tgQueryItem

Trim() public method

Removes blanks from the beginning and end of the column
public Trim ( ) : tgQueryItem
return tgQueryItem

Var() public method

Aggregate Var. See tgQuerySubOperatorType Enumeration.
public Var ( ) : tgQueryItem
return tgQueryItem

operator() public static method

public static operator ( ) : tgComparison
return tgComparison

operator() public static method

public static operator ( ) : tgQueryItem
return tgQueryItem

tgQueryItem() public method

The tgQueryItem class is dynamically created by your BusinessEntity's DynamicQuery mechanism.
public tgQueryItem ( tgDynamicQuerySerializable query, string columnName, tgSystemType datatype ) : System
query tgDynamicQuerySerializable The esDynamicQueryTransport passed in via DynamicQuery
columnName string The columnName passed in via DynamicQuery
datatype tgSystemType The tgSystemType
return System