Reputation: 33739
Lets say there is a User entity, and there is a Group entity, User has a GroupId to relate it to a group, and there is a Group navigation property on the User entity.
I have retrieved 1 User through EF. when I do user.Group.Name does EF run a sql query to join it with group to get the name of the group, or did it get that data when I got the user object?
Upvotes: 0
Views: 967
Reputation: 9416
Entity Framework supports three ways to load related data.
A quick read of the following blog could be of help http://blogs.msdn.com/b/adonet/archive/2011/01/31/using-dbcontext-in-ef-feature-ctp5-part-6-loading-related-entities.aspx
Upvotes: 1