Does anybody know how to create a function import in an Entity Data Model that returns a collection of entity types that also includes the reference types. For instance, in LINQ to entities you can use the .Include() method to load a certain refer开发者_开发知识库enced entity from the DB. I have a stored procedure that returns data from two tables and I want to populate both entity objects from this stored procedure, but when I step through the wizard to create the function import, it only gives the option of creating collections of one entity type at a time.
Any help is much appreciated.
As I know it is not supported. Stored procedures in EFv4 can return only single result set which is directly mapped to single selected entity type. Relations are not populated.
You must populate entities manually if want to load relations as well.
精彩评论