Generates a standard SQL matching clause.
Namespace: CleanCode.DataAssembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
public string GetMatchPhrase(
string fieldName,
string value
)
Public Function GetMatchPhrase ( _
fieldName As String, _
value As String _
) As String
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.