Question

I've got a list of projects.

Countless projects

That has four numbers in it, let's say 2, 5, 6, and 9.

and here are all of my projects.

 IEnumerable<Project> AllProjects = await ctx.Projects.Where(x => x.ClientID == clientid).Where(y => y.Released == true).ToListAsync();

Project IDs 2, 5, 6, and 9 should be used to filter my All Projects.

ought should be anything similar to...

 AllProjects = AllProjects.Where(x=>x.ProjectID == ????)

Thanks

1
3
12/10/2014 7:44:35 AM

Accepted Answer

AllProjects = AllProjects.Where(x=>projects.Contains(x.ProjectID))

Just make sure the projects list has the ID you're looking for.

7
12/10/2014 7:47:02 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow