CleanCode C# Libraries v0.9.23 API

SqlFilterBuilder.GetAlternation Method 

Handles zero, one, or more phrases, returning a standard SQL or clause.

public string GetAlternation(
   params String[] phrase
);

Parameters

phrase
List of zero or more phrases to combine.

Return Value

SQL predicate with 'OR' operators as necessary.

Remarks

With an argument list of, e.g., "phrase-x", "phrase-y", "phrase-z", the result will be (phrase-x OR phrase-y OR phrase-Z). Use GetPhrase to generate the individual phrases passed as arguments to this method. This method is well-suited to automatic clause generation because any null or zero-length arguments will be skipped. See GetConjunction for an example of how this saves a lot of unnecessary coding on your part.

See Also

SqlFilterBuilder Class | CleanCode.Data Namespace