TODO: Byrden - needs a new home (category) and a complete rewrite
Old content from Better LINQ on .ASPX pasted below
Despite what it looks like, the var keyword is not a throwback to the dark ages where we did not have strongly typed variables. It is just a short hand to save developers from typing out the type of a variable.
IQueryable<Customers> results =
from c in dbContext.Customers
where c.CompanyName.StartsWith(companyNameTextbox.Text)
select c;
customersBindingSource.DataSource = results;
Figure: Bad example - You should just use "var" instead of "IQueryable"
var results =
from c in dbContext.Customers
where c.CompanyName.StartsWith(companyNameTextbox.Text)
select c;
customersBindingSource.DataSource = results;
Figure: Good example - Using "var" to save few keystrokes
Love it
0
Agree
0
Disagree
0
No way
0