I am an experienced developer in C# and working on LOB application from last 7 Years, I have some issues in understanding the usage of Lambda expression in programming.
As far as I understand, it is useful in case of
- Working with LINQ (Grouping, Select,Where etc..)
- We can pass Lambda expression to any function as argument, so it can be used in place of delegate or anonymous function or normal function.
We can create generic lambda function which takes any datatype variable as argument and can return any datatype, e.g.
MyFirstLambdaFunc((val1,val2) => val1+val2) public R MyFirstLambdaFunc(Func lambdaexpression,T x,T y) { R Result = lambdaexpression(x, y); return Result; }
Coding can be compact
Now the question is:
- Are there any other advantages?
- When we pass lambda expression as function, can we pass only a single line operation?
- Can anybody have some case study or some practical example document?
Thanks in Advance
Harish Bhattbhatt