Hi folks,
I've got a pretty simple Linq to Sql statement that (on he surface) is working fine. When I check the sql code that it generates, it's trying to retrieve all of the table fields instead of the fields that I just request. Is this normal practice?
here's some psedo code for the linq to sql query :-
var result = (from q in db.Foos
where blah blah blah
orderby more blah
select new ResultThingy
{
A = q.A, // int
B = q.B, // string
C = q.Bar.A // int
D = q.Bar.B // string
})
.Take(5)
.ToList();
Now, it's retreiving all the values from table Bar ... (and a few other fields).
Is this normal practice? Notice how each property in the ResultThingy class is a simple type?
Hmmm... thoughts? I'm really confused over this.