private string GetFilterValue(OperatorId operatorId, string[] values) { if (values.Length == 0) { return(null); } switch (operatorId) { case OperatorId.Equals: case OperatorId.MatchPrefix: if (values.Length > 1) { throw new InvalidParametersCountException($"Operator {operatorId.GetAttribute<EnumMemberAttribute>().Value} can not have more than one value"); } return(values[0]); case OperatorId.LessThan: if (values.Length > 1) { throw new InvalidParametersCountException($"Operator {operatorId.GetAttribute<EnumMemberAttribute>().Value} can not have more than one value"); } return($"lt{values[0]}"); case OperatorId.GreaterThan: if (values.Length > 1) { throw new InvalidParametersCountException($"Operator {operatorId.GetAttribute<EnumMemberAttribute>().Value} can not have more than one value"); } return($"gt{values[0]}"); case OperatorId.IsIn: return(string.Join(",", values)); case OperatorId.Range: if (values.Length != 2) { throw new InvalidParametersCountException($"Operator {operatorId.GetAttribute<EnumMemberAttribute>().Value} can have only two values"); } return($"gt{values[0]},lt{values[1]}"); default: return(null); } }