Well stored procedures are not composable. So there is no way to call your SPROC and have the EF automatically populate relationships in the same query, using Include() or something.
So say you have products and categories
and you have a sproc to get Products:
i.e.
var products = context.GetProducts(someproductfilter);
the resulting products won't have their categories loaded.
However if you have a second stored procedure that gets the Categories for said products:
i.e.
var categories = context.GetCategoriesForProducts(someproductfilter);
a feature in EF called relationship fixup, which links related entities once the second entity enters the context, will insure that after both calls are made, each product in products will have a non-null Category.
This is not ideal, because you are doing more than one query, but it will work.
An alternative is to use EFExtensions. The guy who wrote that created the ability to write sprocs that load more data in one go.
Hope this helps
Cheers
Alex
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…