Thursday, April 22, 2010

A Few New Things In .Net 4 & C# 4


Basically a better option than using object[] in some scenarios (Tuple elements are typed).

Useful For

· Creating arbitrarily sized sets of individually typed elements (can be longer than 8, just tricky).

· Creating functions with multiple return values.

· Create simple structs/classes on the fly.

· Pass multiple parameters in a single one (e.g. Thread.Start(Object)).


Used to make plug-ins.

(Also note the similar preexisting alternative, MAF, in the System.Addin namespace).


This is the guy responsible for all of the dynamic keyword magic. You can subclass this to create your own dynamic objects (e.g. all properties on your object can dynamically be mapped to xml elements).


This is the guy that you can add members to dynamically.

Named & Optional Parameters

Yay, C# has optional parameters now!


Getting fancy with threading syntax.


Super threading (thread pool enhancements).

Exception Handling Changes

Boring… but probably very important to know.


  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.


  2. I love what you guys do too. Such clever work and reporting! Keep up the superb work guys… If you want to travel to Turkey. To apply for a Turkey transit visa, applicants have to fill out a Turkey visa application.

  3. I appreciate your efforts... you have done your job well... keep it up... A passport size photo is also an important document in a visa application form. You must ensure that your passport size photo fulfills the Kenya passport photo size requirements because it is important to avoid visa rejection.