not contains

Hi!

I have a problem using the LINQ Contains filter. I'm trying to get all the records tha do not contain a specific word, but I can't make it work.

It's probably a small thing, but I just can't find it in the manual od by guessing :slight_smile:

Here's the code:

  adsLocations.SetSourceCriteria(fmgrAurelius.Find<TLocation>.Where(not Linq['DenyUser'].Contains(CurrentUser.UserName)));

This code gives me no records

But if I remove the "not" part, I get exactly the records that I would like to discard, so the problem is somewhere with the "not"

Please help (again! :) ).

Did you make sure you have any record at all that DO NOT contains the value for CurrentUser.UserName?

This experssion works fine for me (Delphi 11, Aurelius latest version, Firedac, Firebird 3)

Regards,

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.