【发布时间】:2009-06-11 00:18:22
【问题描述】:
我有一个身份值的 HashSet,我需要将其用作查询值以从实体框架返回 ObjectResult
这是哈希集:
HashSet<int> officeIds = new HashSet<int>();
这是我尝试或多或少地运行的查询:
ObjectResult<FilingOffice> offices = ctx.FilingOffice.Where(office => office IN officeIds.ToList());
上面的“office => office IN officeIds.ToList()”部分是我无法开始工作的部分,也没有在网络上找到任何示例来返回给定主键列表的对象。
ctx 是 System.Data.Objects.ObjectContext
【问题讨论】:
标签: c# entity-framework