WebApi
Let's have a Person class with many one-to-many relations to classes like Car, Pet, Children ...
and PersonRepository where i have to include all relations and their relations or just disable lazy-loading
public Person getPerson()
{
...
using (db = new DbContext())
{
// var person = linq-query
// return person;
}
...
}
So in my controller i have fully loaded Person with relations and their relations.
If there is array of objects with many nested relations it is inefficient and memory demanding.
How i can lazy-load properties outside of repository or what is general solution to this problem?