public static string GetOperatorToken(JobFilterOperator @operator) { switch (@operator) { case JobFilterOperator.Equals: return("="); case JobFilterOperator.NotEquals: return("<>"); case JobFilterOperator.GreaterThanOrEqualTo: return(">="); case JobFilterOperator.GreaterThan: return(">"); case JobFilterOperator.LessThanOrEqualTo: return("<="); case JobFilterOperator.LessThan: return("<"); case JobFilterOperator.StartsWith: return("^="); case JobFilterOperator.Contains: return("*="); case JobFilterOperator.EndsWith: return("$="); default: throw new EnumValueNotImplementedException <JobFilterOperator>(@operator); } }
public JobFilter(SyncSide syncSide, string fieldName, JobFilterOperator @operator, object value, bool encloseValueInSingleQuotes = true) { if (String.IsNullOrWhiteSpace(fieldName)) { throw new Exception("Field name is missing or empty."); } SyncSide = syncSide; FieldName = fieldName; Operator = @operator; Value = value; EncloseValueInSingleQuotes = encloseValueInSingleQuotes; }