<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d23110236\x26blogName\x3dMicrosoft+.NET+Technology+C%23,ASP.NET+...\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dSILVER\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://dotnettechnology.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttps://dotnettechnology.blogspot.com/\x26vt\x3d-5603669659081370377', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Sponsored by..

C# 3.0 new language features

Thursday, March 02, 2006

We dint' even digest C# 2.0 features completely,yet the specifications for C# 3.0 were released at PDC 2005!!

In C# 3.0 there will be radical additions:
"select, from, where" keywords allowing to query from SQL, XML, collections, and more (Language integrated query (LINQ))

Object initialization :
Customer c = new Customer(); c.Name="James"; becomes Customer c = new Customer { Name="James" };

Lambda expressions :
listOfFoo.Where(delegate(Foo x) { return x.size>10;}) becomes listOfFoo.Where(x => x.size>10);

Local variable type inference:
var x = "hello"; is interchangeable with string x = "hello";

Anonymous types :
var x = new { Name = "James" }
Extension methods (adding methods to classes by including the this keyword in the first parameter)

Get more of C# 3.0 from Maliks' Article or from the makers itself!!

Bookmark this post to del.icio.us Digg this post! Bookmark this post to Yahoo! My Web Bookmark this post to Furl
  1. Blogger vijju | 7:45 PM |  

    hey nice template... i got a problem while using this template from bloggertemplates.com.. can u send your template XML content as a file to my mail (vijjub4u@gmail.com). Thanks

Leave your response