标签:linq-to-entities
-
LINQ where子句与第二个where一起引发错误 - c#
更新 即使在联系人的名字或姓氏上进行搜索也会导致问题: var contacts = ( from c in context.ContactSet join m in context.py3_membershipSet on c.ContactId equals m.py3_Member.Id where m.statuscode.Value == 1 &a […]
-
是否有一种简单的方法来处理linq-to-entities查询中的重音符号 - c#
假设我有可汗的数据库。我可以使用此实体框架代码按名称提取可汗 Khan khan=context.Khans.Where(x=>x.Name.Contains("Öge")).Single(); 问题在于,在实践中,用户将键入“ Oge”而不是“Öge”,并且不会获得任何匹配项。有没有一种简单的方法可以解决这个问题,以便带有重音符号 […]
-
实体框架选择项目在有序列表中的位置 - c#
我想在有序列表中选择用户的位置。 我只能通过将所有项目加载到内存中然后使用IndexAt()方法查找位置来使其工作。但是,当数据库中有很多行时,这并不是很好。 public static async Task<int> GetUsersRank(DbEntities db, string userId) { var items = await d […]