SqlFilterBuilder GetMatchPhrase Method CleanCode C# Libraries v1.2.03 API
Generates a standard SQL matching clause.

Namespace: CleanCode.Data
Assembly: CleanCode (in CleanCode.dll) Version: (1.2.03)

public string GetMatchPhrase(
	string fieldName,
	string value

Return Value

Approximation SQL predicate.

This adds the percent mark (%) to the front and back of the value and generates a matching clause. Example: GetMatchPhrase("Type", "abc") yields [Type] LIKE '%abc%'. Contrast this with the form of GetPhrase(String,  String ) which yields the same result: GetPhrase("Type", "%abc%") In the latter method call, we explicitly include the percent marks, enabling the generic phrase builder to recognize that it needs a matching clause. Also, with GetPhrase we may include a leading percent, a trailing percent, or both. GetMatchPhrase always adds both a leading and trailing percent.
See Also