public static Type OperatorTypeToAdvancedFilter(AdvancedFilterOperatorType operatorType) { return(operatorType switch { AdvancedFilterOperatorType.NumberIn => typeof(NumberInAdvancedFilter), AdvancedFilterOperatorType.NumberNotIn => typeof(NumberNotInAdvancedFilter), AdvancedFilterOperatorType.NumberLessThan => typeof(NumberLessThanAdvancedFilter), AdvancedFilterOperatorType.NumberLessThanOrEquals => typeof(NumberLessThanOrEqualsAdvancedFilter), AdvancedFilterOperatorType.NumberGreaterThan => typeof(NumberGreaterThanAdvancedFilter), AdvancedFilterOperatorType.NumberGreaterThanOrEquals => typeof(NumberGreaterThanOrEqualsAdvancedFilter), AdvancedFilterOperatorType.BoolEquals => typeof(BoolEqualsAdvancedFilter), AdvancedFilterOperatorType.StringIn => typeof(StringInAdvancedFilter), AdvancedFilterOperatorType.StringNotIn => typeof(StringNotInAdvancedFilter), AdvancedFilterOperatorType.StringBeginsWith => typeof(StringBeginsWithAdvancedFilter), AdvancedFilterOperatorType.StringEndsWith => typeof(StringEndsWithAdvancedFilter), AdvancedFilterOperatorType.StringContains => typeof(StringContainsAdvancedFilter), _ => throw new ArgumentException($"Advanced Filter operatorType {operatorType} not supported"), });
public static Type OperatorTypeToAdvancedFilter(AdvancedFilterOperatorType operatorType) { switch (operatorType) { case AdvancedFilterOperatorType.NumberIn: return(typeof(NumberInAdvancedFilter)); case AdvancedFilterOperatorType.NumberNotIn: return(typeof(NumberNotInAdvancedFilter)); case AdvancedFilterOperatorType.NumberLessThan: return(typeof(NumberLessThanAdvancedFilter)); case AdvancedFilterOperatorType.NumberLessThanOrEquals: return(typeof(NumberLessThanOrEqualsAdvancedFilter)); case AdvancedFilterOperatorType.NumberGreaterThan: return(typeof(NumberGreaterThanAdvancedFilter)); case AdvancedFilterOperatorType.NumberGreaterThanOrEquals: return(typeof(NumberGreaterThanOrEqualsAdvancedFilter)); case AdvancedFilterOperatorType.BoolEquals: return(typeof(BoolEqualsAdvancedFilter)); case AdvancedFilterOperatorType.StringIn: return(typeof(StringInAdvancedFilter)); case AdvancedFilterOperatorType.StringNotIn: return(typeof(StringNotInAdvancedFilter)); case AdvancedFilterOperatorType.StringBeginsWith: return(typeof(StringBeginsWithAdvancedFilter)); case AdvancedFilterOperatorType.StringEndsWith: return(typeof(StringEndsWithAdvancedFilter)); case AdvancedFilterOperatorType.StringContains: return(typeof(StringContainsAdvancedFilter)); default: throw new ArgumentException($"Advanced Filter operatorType {operatorType} not supported"); } }