use*_*985 3 c# entity-framework
我有一个HashSet的Identity值,我需要将其用作查询值以从Entity Framework返回ObjectResult
这是HashSet:
HashSet<int> officeIds = new HashSet<int>();
Run Code Online (Sandbox Code Playgroud)
这是我试图或多或少地运行的查询:
ObjectResult<FilingOffice> offices = ctx.FilingOffice.Where(office => office IN officeIds.ToList());
Run Code Online (Sandbox Code Playgroud)
以上部分的"office => office IN officeIds.ToList()"部分是我无法工作的,并且在给定主键列表的情况下没有在Web上找到任何用于返回对象的样本.
ctx是System.Data.Objects.ObjectContext