Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on WhereContains #707

Closed
joc-luis opened this issue Feb 18, 2024 · 1 comment
Closed

Error on WhereContains #707

joc-luis opened this issue Feb 18, 2024 · 1 comment

Comments

@joc-luis
Copy link

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

@Revazashvili
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants