Using ASP.NET 4.5 and EF 6, I've put together a multilevel data model that looks like this:
Organization, which has an ICollection of:
_____Workspaces, which has an ICollection of:
__________Projects, which has an ICollection of:
_______________Cards
When I ask the database for a list of organizations using the following code, I get a giant multilevel nested response all the objects in the database.
var orgs = await (from o in db.Organizations select o).ToListAsync();
How do I specify that I just want the top level to be returned? (or any other specific depth of search?)
I'm sure this is easy, but I'm new to SQL C# world and don't know the proper language to find useful Google or SO answers...
Update: kienct89 gets the win!
"Lazy Loading" is the right term, and here's some good info about it.