XAF0032: Use the explicit syntax to create an instance of the CriteriaOperator class
Severity: Warning
Avoid implicit conversion of strings to CriteriaOperator. Use explicit syntax to create the CriteriaOperator
instances instead.
For more information, refer to the following topics:
- FromLambda<TModel>(Expression<Func<TModel, Boolean>>)
- FromLambda<TModel, TResult>(Expression<Func<TModel, TResult>>)
Examples
Invalid Code
CriteriaOperator criteria = "A > B";
Valid Code
CriteriaOperator criteria = CriteriaOperator.FromLambda<MyType>(x => x.A > x.B);
// or
CriteriaOperator criteria = CriteriaOperator.Parse("A > B");