开发者

How do I do a "like" wildcard comparison in Entity Framework in .NET 4.0?

开发者 https://www.devze.com 2022-12-21 17:41 出处:网络
I\'m using the Visual Studio 2010 RC for .NET 4.0 and I\'m trying to figure out how to do a wildcard comparison with Entity Framework.

I'm using the Visual Studio 2010 RC for .NET 4.0 and I'm trying to figure out how to do a wildcard comparison with Entity Framework.

I'd like to have the following query for EF where I find all the names that start with 'J'

select * from Use开发者_JAVA技巧rs where FirstName like 'J%'


from user in Users where user.FirstName.StartsWith("J") select user;


Use:

var query = Users.Where(user => user.FirstName.StartsWith("J"));


I would refer you to this question, I assume it hasn't changed in .net 4.0

0

精彩评论

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