Closed joc-luis closed 5 months ago
i guess you're using postgres database, WhereContains takes parameter caseSensitive
which is false by default, if it's false compiler generates ILIKE operator otherwise LIKE, so try passing true in caseSensitive
parameter.
When the following query is executed:
new Query("Users").Join("Roles", "Roles.Id", "RoleId") .Select("Users.Id", "Users.Nick", "Users.Email", "Roles.Name as Role", "RoleId") .WhereContains("Users.Nick", request.Value) .PaginateAsync<TEntity>(1, 100, cancellationToken: ct)
The result in string is:
SELECT "Users"."Id", "Users"."Nick", "Users"."Email", "Roles"."Name" AS "Role", "RoleId" FROM "Users" INNER JOIN "Roles" ON "Roles"."Id" = "RoleId" WHERE "Users"."Nick" ilike '%m%'
For some reason an i is added to the beginning of the like