Dynamic Linq and use of Between

c#-4.0 dynamic-linq entity-framework-6 linq-to-entities

Question

I am having a Dynamic Linq where It should perform comparison between two integers. I tried so many but none of them worked for me.

Code

db.Bibs.Where(" Id >=  1 && Id<1000 ")
db.Bibs.Where(" Id between  1 && 1000 ")

How to form this string to make it work. Any suggestion will be highly appreciated.

1
0
6/3/2015 5:53:38 AM

Popular Answer

Assuming this is SQL Server, it doesn't understand && use AND instead:

db.Bibs.Where(" Id BETWEEN 1 AND 1000 ")

http://weblogs.asp.net/scottgu/dynamic-linq-part-1-using-the-linq-dynamic-query-library

1
6/3/2015 5:04:17 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow