Parameters and example FuncLike

FuncLike - equivalent of the test for occurrence of a substring in another string in SQL Builder function limitations SQLWhereLanguageDef.

Parameters GetFunction

GetFunction accepts the first argument type of a function funcLike, and then takes 2 objects to compare them with each other. The first is sent to the variable description (Variable Definition), which will determine the objects to сравнения; and the second parameter is the mask, which will be compared.

Example usage

Let’s consider an example. Required to deduct all Клиентов with a residence permit in the city of Perm. (For simplicity, we assume sufficient availability of the word “Perm” in the line Клиент.Прописка)

The SQL statement would look as follows:

SELECT * FROM Клиент 
WHERE Прописка like '%Пермь%'

SQLWhereLanguageDef:

SQLWhereLanguageDef langdef = SQLWhereLanguageDef.LanguageDef;
Function lf = langdef.GetFunction(
			langdef.funcLike,
			new VariableDef(langdef.StringType, Information.ExtractPropertyPath<Клиент>(x => x.Прописка)), 
			"%Perm%");