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…