StringConditionExpression
Table of Contents
What it is
StringConditionExpression is used to evaluate a String property (of field or variable). Depending on the outcome, the result will then be either String1 or String2.
- See LINQ for details about LINQ and the AI-Framework.
- Go to the category for all LINQ expressions.
Code example
public StringProperty StringExample1 => StringProperty(description: "first example");
public StringProperty StringExample2 => StringProperty(description: "second example");
public ReadOnlyStringProperty StringResult
{
get
{
return CalculatedStringProperty(() =>
StringExample1.IsEqualTo(StringExample2).IsTrueElse(StringExample1, StringExample2));
}
}
Explanation of the example
Line 9 evaluates if StringExample1 is equal to StringExample2.
If so, StringExample1 will be assigned to the CalculatedStringProperty StringResult, otherwise StringExample2 will be assigned to StringResult.