I have a People table, I want a method that return one Person by id, with numbers of Cars, number of houses, etc.
I need to Load this tables together? I see SQL generated by EF, is a monster.
Ex:
public Person Get()
{
return context.People.Include("Cars").Include("Houses").Where(x=> x.Id = 1).First();
}
My view use this:
Name: <%= people.Name%>
Cars: <%= people.Cars.Count%>
Houses: <%= people.Houses.Count%>