Class DateDiffQueryFunction
The function of expressing the date difference obtained by subtracting the specified dates.
Inherited Members
Namespace: Terrasoft.Core.DB
Assembly: Terrasoft.Core.dll
Syntax
public class DateDiffQueryFunction : QueryFunction, IQueryColumnExpressionConvertible, IQueryColumnExpressionsCollector, ICloneable
Constructors
DateDiffQueryFunction(DateDiffQueryFunction)
Initializes the DateDiffQueryFunction instance that is a clone of the passed-in function.
Declaration
public DateDiffQueryFunction(DateDiffQueryFunction source)
Parameters
Type | Name | Description |
---|---|---|
DateDiffQueryFunction | source | The instance of the DateDiffQueryFunction function whose clone is being created. |
DateDiffQueryFunction(DateDiffQueryFunctionInterval, IQueryColumnExpressionConvertible, IQueryColumnExpressionConvertible)
Initializes the DateDiffQueryFunction instance with the specified parameters.
Declaration
public DateDiffQueryFunction(DateDiffQueryFunctionInterval interval, IQueryColumnExpressionConvertible startDateExpression, IQueryColumnExpressionConvertible endDateExpression)
Parameters
Type | Name | Description |
---|---|---|
DateDiffQueryFunctionInterval | interval | Unit of measurement of the date difference. |
IQueryColumnExpressionConvertible | startDateExpression | An expression of the column containing the start date. |
IQueryColumnExpressionConvertible | endDateExpression | An expression of the column containing the end date. |
Exceptions
Type | Condition |
---|---|
ArgumentNullOrEmptyException | If the |
DateDiffQueryFunction(DateDiffQueryFunctionInterval, QueryColumnExpression, QueryColumnExpression)
Initializes the DateDiffQueryFunction instance with the specified parameters.
Declaration
public DateDiffQueryFunction(DateDiffQueryFunctionInterval interval, QueryColumnExpression startDateExpression, QueryColumnExpression endDateExpression)
Parameters
Type | Name | Description |
---|---|---|
DateDiffQueryFunctionInterval | interval | Unit of measurement of the date difference. |
QueryColumnExpression | startDateExpression | An expression of the column containing the start date. |
QueryColumnExpression | endDateExpression | An expression of the column containing the end date. |
Properties
EndDateExpression
An expression of the column containing the end date.
Declaration
public QueryColumnExpression EndDateExpression { get; set; }
Property Value
Type | Description |
---|---|
QueryColumnExpression |
Interval
Unit of measurement of the date difference returned by function.
Declaration
public DateDiffQueryFunctionInterval Interval { get; set; }
Property Value
Type | Description |
---|---|
DateDiffQueryFunctionInterval |
StartDateExpression
An expression of the column containing the start date.
Declaration
public QueryColumnExpression StartDateExpression { get; set; }
Property Value
Type | Description |
---|---|
QueryColumnExpression |
UseEndExpressionUtcOffset
Declaration
public bool UseEndExpressionUtcOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseStartExpressionUtcOffset
Declaration
public bool UseStartExpressionUtcOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddQueryColumnExpressions(QueryColumnExpressionCollection)
Declaration
protected override void AddQueryColumnExpressions(QueryColumnExpressionCollection collection)
Parameters
Type | Name | Description |
---|---|---|
QueryColumnExpressionCollection | collection |
Overrides
AddUsingParameters(QueryParameterCollection)
In the function arguments adds the passed-in collection of parameters.
Declaration
public override void AddUsingParameters(QueryParameterCollection resultParameters)
Parameters
Type | Name | Description |
---|---|---|
QueryParameterCollection | resultParameters | Collection of the query parameters. |
Overrides
BuildSqlText(StringBuilder, DBEngine)
Generates the query text, using the specified System.Text.StringBuilder instance and the DBEngine query builder.
Declaration
public override void BuildSqlText(StringBuilder sb, DBEngine dbEngine)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | sb | The System.Text.StringBuilder instance used to create query text. |
DBEngine | dbEngine | The instance of the builder of the database queries. |
Overrides
Clone()
Creates the clone of the current DatePartQueryFunction instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new DateDiffQueryFunction instance that is a clone of the current instance. |