If I use entity framework with linq to sql to query it and I have an object Person but I only need two properties of that object, what's in memory will be load, the entire object ?
Example :
I got the entity Person with properties : Name, Age, Address, Country, Language ...
I only need to use the property Name and Age. So I got no need to load the address, country and other property ... what will be in memory and what type of query will be ask to SQL ?
If my Linq query is :
public IQueryable<Person> FindAllPersons()
{
return from person in db.Persons
select person;
}
And later in code I only call the Name and Age property of each Person in the list.