Say my object graph looks like:
User
=> Friends
=> Clicks
=> Urls
So when I load a User, I also want to eagirly load the navigation property Friends. And I want the friend object to eagirly load Clicks and so on.
Using the code I have now I can only do this for 1 level:
public User GetUserById(int userId)
{
return Get(x => x.Id == userId, includeProperties: "Friends").FirstOrDeafult();
}
Is this possible?
- I'm using MVC 4.1
- I'm currently using the repository pattern based on http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application