开发者

Entity Framework LINQ - How to perform an alphabetical string comparison e.g. Where Name > "Bob"

开发者 https://www.devze.com 2023-04-12 02:22 出处:网络
In TSQL I can do this: select * from Person where Name > \'Bob\' How do I do this with an entity framework LINQ query?

In TSQL I can do this:

select * from Person where Name > 'Bob'

How do I do this with an entity framework LINQ query?

var results = db.People.Where(p开发者_如何学Python => p.Name > "Bob"); // error


You have to use .compareTo to do a string comparison.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号