Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Linq and Where Clause & NOT Contains

Tags:

dynamic

linq

.Where("MyColumn.Contains(@0)", "column_value")

I would like to know the syntax or the correct way to have NOT contains in dynamic linq.

like image 309
user2682650 Avatar asked Oct 28 '25 04:10

user2682650


1 Answers

All of these worked for me:

collection.Where("!MyColumn.Contains(@0)", "value");
collection.Where("MyColumn.Contains(@0) = false", "value");
collection.Where("MyColumn.Contains(@0) == false", "value");

I used System.Linq.Dynamic (version 1.0.2) from NuGet.

like image 148
ken Avatar answered Oct 30 '25 03:10

ken



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!