Using LINQ to entities, I'm trying to filter a list based on another list.
My first list looks like:
IQueryable<FooViewModel> allFoos = from foo in ctx.Foo
select new FooViewModel
{
code = foo.Code,
text = foo.Text,
...
};
My second list looks like:
IQueryable<FooViewModel> myBars = from bar in ctx.Bar.Include("Baz") select bar
There are multiple bazes per bar, and baz has Code and Text properties.
I want to filter allFoos so that I get back only those elements where Code == baz.Code && text == baz.Text