Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
What is lambda expressions
Posted By :
Posted Date :
February 02, 2011
A lambda expression is an unnamed method written in place of delegate instance.It has th following form
(Parameter => expression or state,ent block.
You can also find related Interview Question to
What is lambda expressions
How to get the sum of last 3 items in a list using Lambda Expressions?
int sum = list.Reverse().Take(3).Sum();
How to find the index of element using Where() with Lambda Expressions?
Use the two argumented Lambda method
Where((i, ix) => i == ix);
How to select the top n numbers from an IList using lambda expressions?
Use Take() extension method.
What is the method to convert one type to another using Lambda expressions?
What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?
Polish and Reverse Polish notations.
What is the namespace used for regular expressions?
In Analysis service what is the technology used define the expressions?
Multidimensional Expressions also abbrevated as MDX
What is Lambda Expression?
msdn: A Lambda expression is an anonymous function that can contain expressions and statements.
All lambda expressions use the => (goes to) operator
The left side of => holds the parameters if any
The right side holds the expressions or statements
There are expression lambdas and statement lambdas
How Where() method using Lambda Expression implemented for List in C#?
Using Extension Methods
Which is the Lambda Expression enabled extension method to check all elements satisfies given condition?
Which is the Lambda Expression enabled extension method to check any elements satisfies given condition?
Is the method Where() using lambda expression returns values immediately.
Nope. It is deferred execution. It will return an object which contains the information to execute the query. The actual filtering happens when the enumeration of elements starts.
The enumeration could be started by using a foreach loop.
How to convert a list of objects to another type using lambda?
Using Select() method
What is a Lambda expression?
A Lambda expression is nothing but an Anonymous Function, can contain expressions and statements. Lambda expressions can be used mostly to create delegates or expression tree types. Lambda expression uses lambda operator => and read as 'goes to' operator.
Example: myExp = myExp/10;
The => operator has the same precedence as assignment (=) and is right-associative.
Lambdas are used in method-based LINQ queries as arguments to standard query operator methods such as Where.
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend