Query.Not() doesn't apply to WhereRaw
SunnyC17 opened this issue · 2 comments
SunnyC17 commented
When I am using Not(), the WhereRaw clause is not negated. I have to use WhereRaw instead of Where in my use case so would there be a fix to this issue? Suggestions for work-around will also be appreciated.
var query = new Query("Posts").Not();
query = query.WhereRaw("lower(Title) = ?", "sql");
returns
SELECT
*
FROM
[Posts]
WHERE
lower(Title) = 'sql'
ahmad-moussawi commented
Yes this intended, and should be mentioned in the doc, why not negating directly your expression?
as a workaround you can nest your condition with
`WhereNot(q => q.WhereRaw("A = B"))
SunnyC17 commented
Thanks for the workaround, the issue at my end has been resolved.