none
EF 4.1 Explicit Loading related entities with a string navigation property RRS feed

  • Question

  • Hi

    I did test EF 4.1 new functionality to explicit load navigation properties with new .collection("navigation property").Load() functionality like described here: http://blogs.msdn.com/b/adonet/archive/2011/01/31/using-dbcontext-in-ef-feature-ctp5-part-6-loading-related-entities.aspx

    This all works fine as long as I use a string only with 1 Navigation property like "ContactPersons".

    If I try to do use it with "ContactPersons.ContactPersonsContactFacilities" then I get an error message:

    "The property path 'ContactPersons.ContactPersonsContactFacilities' cannot be used for navigation properties. Property paths can only be used to access primitive or complex properties."

    Is this not working the same way as the .include works?

    Is there some way to do it? I would like to pass a string with my navigation property to the load method.

    Thanks

     

    Beat


    Beat Wuethrich
    Thursday, June 16, 2011 7:16 AM

Answers

  • Hi Beat,

    Thanks for your feedback.

    I mean you couldn't pass in a path string in the collection method to load all related entities like Include method.

    Thanks for understanding.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 20, 2011 9:09 AM
    Moderator

All replies