<< Obfuscated >>
In my repository I declare IQueryable<Foo> foos and ConfigEntities db = new ConfigEntities() I then query the db with the linq query
foos = from f in _db.Foos
select f;
Each Foo has an individual collection of EntityCollection<Bar> bars that is automagically populated by the Entity Framework.
I want to iterate over the foos collection and over the bars collections in each Foo, and modify the bars collection based on the date, something like:
from foo in foos
(from bar in foo.bars
where bar.Date < someDate && bar.Date >= someOtherDate
select bar)
select foo
So I get back all of the foos with a subset of the original bars. I’m not sure how, but I think I want to do a select within a select or something of that sort.
Any help would be appreciated.
or (edited, considering you don’t have the corresponding constructor for
Foo)This will give a collection of “tuples”, where each will contain the original
Foo(with all theBars) and also a collection of theBars you want.