0

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.

DonMax
  • 970
  • 3
  • 12
  • 47

1 Answers1

1

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

Steve Greene
  • 12,029
  • 1
  • 33
  • 54