Author: dooie | Posted on: 10/9/2009 9:30:17 AM | Views : 265

I am tryig to solve a problem.
I have two related tables 'Locations' & 'Schools' both have an 'IsActive' field. Locations can have a number of schools.
I need a List<> of Active locations with active schools. I can get the active Locations using the following;


public IQueryable<Location> GetActiveLocationsAndSchools()
{
return db.Locations.Where(l => l.LocationActive == true);
}


But i cannot work out have to add the last bit to include only active schools, thois just returns all schools related to the locations.


Any Ideas?


Thanks


Doo

...

Go to the complete details ...