You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The negated LINQ contains does not work
Code to Reproduce
This should get me all my objects where StringList does not contain myString results = results.Where(x => !x.StringList.Contains(myString));
The resulting collection is empty however.
A workaround is: results = results.Where(x => x.StringList.All(t => t != myString));
The text was updated successfully, but these errors were encountered:
this usually happens with LINQ query in LiteDB when you does not assign any value for a field it's considered as null (which in turn is a separate data type) and when you query that field you have to avoid those records.
As of now you might see your code first might work as results = results.Where(x => (x.StringList!=null)&&(!x.StringList.Contains(myString)));
Version
5.0.5
Describe the bug
The negated LINQ contains does not work
Code to Reproduce
This should get me all my objects where StringList does not contain myString
results = results.Where(x => !x.StringList.Contains(myString));
The resulting collection is empty however.
A workaround is:
results = results.Where(x => x.StringList.All(t => t != myString));
The text was updated successfully, but these errors were encountered: