Wednesday, June 13, 2012

Anonymous Functions in .Net


As the name suggests Anonymous Functions are the ones which do not have a specific function name, but they do have a function body, the function body is in line with the function, the functions are not declared and called separately, instead they are created and used at a single stretch.

Anonymous functions can be seen as the next version of Delegate programming, earlier in .Net 1.1, delegates were initialized by mapping them to explicit method names which are already defined, the introduction of Anonymous functions helps us to define the method mapped to the delegate to be defined while initializing the delegate. We shall see how this is achieved in the posts and .

Anonymous functions can either evaluate to a Delegate or an Expression depending on the target type to which they are assigned.

There are 2 types of Anonymous functions
  • Anonymous Methods - Introduced in .Net 2.0
  • Lambda Expressions - Introduced in .Net 3.0


To know more about these refer the following posts.


Search Flipkart Products:
Flipkart.com

No comments: