Geeks With Blogs
Tom Stickel Thoughts on Software Engineering January 2012 Entries
Func example
Func<int, int, int> myfunction = (x,y) => x + y; This statement consists of three sections.A declaration: Func<int, int, int> myfunctionAn equals operator: =A lambda expression: (x,y) => x + y;The variable myfunction points at raw executable code that knows how to add two numbers. The lambda expression shown in step three above is a short hand way of writing the following method:public int myfunction(int x, int y) { return x + y; }One can call either the method shown above, or the ......

Posted On Sunday, January 29, 2012 12:36 AM

Copyright © TomStickel | Powered by: