Using C# 2008, one can now declare a variable and allow the compiler to determine the type of the item implicitly.
LINQ uses this capability to work with the queries that are created.
To work with this new capability, the 'var' keyword is being used as:
var x = 100;
When you use this statement, the compiler will actually use the value of 5 to figure out the type that this needs to be. That means, in this case, that the statement will actually be as you would expect:
int x = 100;
No comments:
Post a Comment