Class QueryCase
CASE operator expression.
Implements
Inherited Members
Namespace: Terrasoft.Core.DB
Assembly: Terrasoft.Core.dll
Syntax
public class QueryCase : Collection<QueryCaseItem>, IList<QueryCaseItem>, ICollection<QueryCaseItem>, IList, ICollection, IReadOnlyList<QueryCaseItem>, IReadOnlyCollection<QueryCaseItem>, IEnumerable<QueryCaseItem>, IEnumerable, ICloneable
Constructors
QueryCase()
Initializes the QueryCase instance.
Declaration
public QueryCase()
QueryCase(QueryCase)
Initializes the QueryCase instance that is a copy of the passed-in operator expression.
Declaration
public QueryCase(QueryCase source)
Parameters
Type | Name | Description |
---|---|---|
QueryCase | source | The CASE operator expression whose clone is being created. |
Properties
ElseExpression
Expression of the ELSE clause.
Declaration
public QueryColumnExpression ElseExpression { get; set; }
Property Value
Type | Description |
---|---|
QueryColumnExpression |
Methods
AddWhenItem(QueryCondition, String)
To the current operator expression, adds the expression of the WHEN clause with the specified condition and alias of the resulting expression column.
Declaration
public void AddWhenItem(QueryCondition condition, string resultSourceColumnAlias)
Parameters
Type | Name | Description |
---|---|---|
QueryCondition | condition | The WHEN clause condition. |
System.String | resultSourceColumnAlias | The alias of the resulting expression column. |
AddWhenItem(QueryCondition, Query)
To the current operator expression, adds WHEN clause expression with the specified condition and arbitrary subquery that returns the resulting expression.
Declaration
public void AddWhenItem(QueryCondition condition, Query resultSubSelectQuery)
Parameters
Type | Name | Description |
---|---|---|
QueryCondition | condition | Condition of the WHEN operator clause. |
Query | resultSubSelectQuery | Arbitrary subquery that returns the resulting expression. |
AddWhenItem(QueryCondition, QueryColumnExpression)
To the current operator expression, adds the WHEN clause with the specified condition and expression of the resulting expression column.
Declaration
public void AddWhenItem(QueryCondition condition, QueryColumnExpression resultColumnExpression)
Parameters
Type | Name | Description |
---|---|---|
QueryCondition | condition | The WHEN clause condition. |
QueryColumnExpression | resultColumnExpression | Expression of the resulting expression column. |
AddWhenItem(QueryCondition, QueryParameter)
To the current operator expression, adds WHEN clause expression with the specified condition and parameter of the resulting expression.
Declaration
public void AddWhenItem(QueryCondition condition, QueryParameter resultParameter)
Parameters
Type | Name | Description |
---|---|---|
QueryCondition | condition | The WHEN clause condition. |
QueryParameter | resultParameter | The parameter of the resulting expression. |
AddWhenItem(QueryCondition, Select)
To the current operator expression, adds WHEN clause expression with the specified condition and select subquery that returns the resulting expression.
Declaration
public void AddWhenItem(QueryCondition condition, Select resultSubSelect)
Parameters
Type | Name | Description |
---|---|---|
QueryCondition | condition | The WHEN clause condition. |
Select | resultSubSelect | The select subquery that returns the resulting expression. |
Clone()
Creates the clone of the current QueryCase instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object |
SetElseExpression(String)
Sets the column expression with the given alias as the ELSE clause of the current statement.
Declaration
public void SetElseExpression(string sourceColumnAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
SetElseExpression(Query)
Sets the column expression for the passed-in arbitrary subquery as the ELSE clause of the current operator.
Declaration
public void SetElseExpression(Query subSelectQuery)
Parameters
Type | Name | Description |
---|---|---|
Query | subSelectQuery | Random subquery. |
SetElseExpression(QueryColumnExpression)
Sets the specified column expression as the ELSE clause of the current operator.
Declaration
public void SetElseExpression(QueryColumnExpression columnExpression)
Parameters
Type | Name | Description |
---|---|---|
QueryColumnExpression | columnExpression | The column expression. |
SetElseExpression(QueryParameter)
Sets the column expression for the specified query parameter as the ELSE clause of the current operator.
Declaration
public void SetElseExpression(QueryParameter parameter)
Parameters
Type | Name | Description |
---|---|---|
QueryParameter | parameter | The query parameter. |
SetElseExpression(Select)
Sets the column expression for the passed-in select subquery as the expression of the ELSE clause of the current operator.
Declaration
public void SetElseExpression(Select subSelect)
Parameters
Type | Name | Description |
---|---|---|
Select | subSelect | The select subquery. |