public static OperatorGroup Build <T>( string propertyName, T value, OperatorTestType operatorTestType = OperatorTestType.Equal, OperatorTestOption operatorTestOptions = OperatorTestOption.None, BinaryOperatorType operatorType = BinaryOperatorType.Or, BinaryOperatorType nextOperatorType = BinaryOperatorType.And) { return(new OperatorGroup { PropertyName = propertyName, OperatorType = operatorType, NextOperatorType = nextOperatorType, OperatorTests = new List <IOperatorTest> { OperatorTest.FromProperty(propertyName, value, operatorTestType, operatorTestOptions) } }); }
public static OperatorGroup Build <T>( string propertyName, List <T> values, OperatorTestType operatorTestType = OperatorTestType.Equal, OperatorTestOption operatorTestOptions = OperatorTestOption.None, BinaryOperatorType operatorType = BinaryOperatorType.Or, BinaryOperatorType nextOperatorType = BinaryOperatorType.And) { return(new OperatorGroup { PropertyName = propertyName, OperatorType = operatorType, NextOperatorType = nextOperatorType, OperatorTests = values .Select(x => OperatorTest.FromProperty(propertyName, x, operatorTestType, operatorTestOptions)) .ToList() }); }