Geeks With Blogs
Sudheer Kumar ASP.Net, C#, BizTalk, MSBuild, WPF, WCF, WF....

C #4.0 has been here for a while and it has got many interesting features.

1. dynamic keyword:

It represents an object that will be resolved at run time. For example, assume that you have 2 different classes that have the same signature.

Then you can have a method like this.

private void TestMethod(object myObject)

{

string name = myObject.Name;

string address = myObjec.Address;

}

Now you can pass any object that has the same interface to the TestMethod(). This is some thing which is not possible with a base class.

dynamic has got much more power and more about that later.

2. Parallel Processing:

- PLINQ: Helps to execute a LINQ query that will be parallel processed

return mySearch.AsParallel().Where(x => myCustomFilter(x));

- Parallel Library:

Parallel.For(0; 10000; delegate(int index))
{

//some complex operation

});

more on these topics later…

Posted on Tuesday, September 7, 2010 5:00 AM | Back to top


Comments on this post: .Net 4.0

# re: .Net 4.0
Requesting Gravatar...
thanks for providing the quality information
Left by silicone watch on Aug 19, 2012 7:54 PM

# re: .Net 4.0
Requesting Gravatar...
the object resolved at run time, it was the one from the System?
Left by silicone watch on Aug 19, 2012 8:03 PM

Your comment:
 (will show your gravatar)
 


Copyright © Sudheer Kumar | Powered by: GeeksWithBlogs.net | Join free