.net – Linq to Sql – Loading Child Entities Without Using DataLoadOptions

linqlinq-to-sqlnet

Is it possible to load child entities in a single query without using DataLoadOptions?

I am using one data context per request in an asp.net web application and trying to get around the linq to sql limitation of not being able to change dataloadoptions once a query has been executed.

Thanks.

Best Answer

If you don't mind the link to the data context, as you say you don't, you could write a stored procedure that returns multiple results that map to your objects. Read more about it here.

Related Topic