The var keyword is a new keyword that can infer its data type from the resulting set. For instance, look at the following examples:
var one = 1; //infers an int
var two = "2"; // infers a string
var three = from c in Customers select c; //infers IQueryable<Customer>
var four = customers.FirstOrDefault(); //infers Customer reference
This means full intellisense is available in VS 2008, as long as the compiler can infer the type. The following results in a compile error:
var five = null;
Becuase compiler couldn't infer the type of the variable from null. “Var” is NOT a variant, everything is known by the compiler at compile-time.
Revision number 2, Thursday, October 02, 2008 8:56:36 PM by budugu
You must Login to comment.
Revision #7
Sat, Sep 20, 2008 6:33 PM
by
|
Visual Studio 2008
Visual Studio 2008is theversion of Visual Studio which comes with the .NET Framework 3.5. It was released to MSDN subscribers on 19 November 2007 alongside the.NET Framework 3.5. Visual Studio 2008 can target developmentin .NET Framework versions 2.0, 3.0
|
Revision #4
Mon, Feb 4, 2008 8:00 AM
by
|
Deployment
Deployment continues to get easier, but there's still a few gotchas here and there. Check out these choice articles for you deployment questions. Web Deployment Projects- Fritz Onion's most excellent article on Web Deployment Projects. He goes into
|
New
Mon, Feb 4, 2008 8:00 AM
by
|
LINQDataSource
There's quite a few data source controls in ASP.NET and one that folks are increasingly excited about is the LINQDataSource. Blogs LINQ to SQL (Part 5 - Binding UI using the ASP:LinqDataSource Control) - This is the best place to start to get your head around
|