DateTimeConditionExpression
Table of Contents
What it is
DateTimeConditionExpression is used to evaluate a DateTime property (of field or variable). Depending on the outcome, the result will then be either DateTime1 or DateTime2.
- See LINQ for details about LINQ and the AI-Framework.
- Go to the category for all LINQ expressions.
Code example
public DateTimeProperty DateTimeExample1 => DateTimeProperty(description: "first example");
public DateTimeProperty DateTimeExample2 => DateTimeProperty(description: "second example");
public ReadOnlyDateTimeProperty DateTimeResult
{
get
{
return CalculatedDateTimeProperty(() =>
DateTimeExample1.IsEqualTo(DateTimeExample2).IsTrueElse(DateTimeExample1, DateTimeExample2));
}
}
Explanation of the example
Line 9 evaluates if DateTimeExample1 is equal to DateTimeExample2.
If so, DateTimeExample1 will be assigned to the CalculatedDateTimeProperty DateTimeResult, otherwise DateTimeExample2 will be assigned to DateTimeResult.