开发者

Entity variable get list based on where

I am very开发者_StackOverflow new to EF. So I have an entity variable, how do I say give me all categories that start with 'a'?


You could try something like below, EF should translate StartsWith to LIKE

MyEFContext.SomeTable.Where(someTable => someTable.categories.StartsWith("a"));


var aCategories = from cat in context.Categories
                  where cat.StartsWith("a")
                  select cat;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜