TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kumar Gaurav
NA
23
18k
Lambda expression and anonymous method in c#
Oct 21 2015 1:55 AM
In interview they ask me one question i.e what is
difference between lambda expression and anonymous method
in c#.
I just told him like
Anonymous mehods were introduced in C# 2 and Lambda expression in c# 3.
and suppose we have a list of employee and we have to find employee details with id=105 than by using anonymous mehhod we
write like:
Employee employee= listEmployee.Find(delegate(Employee Emp)
{
return Emp.ID==105
});
And by using Lambda Expression:
Employee employee= listEmployee.Find(Emp=>Emp.ID==102);
means we can't use delegate as a parameter in Lambda Expression.
Lembda expression is mainly use to writing Linq query expression.
But i think Interviewer not satisfy that answer, than what i should have to exataly told?
Reply
Answers (
1
)
Gridview
how to edit values of app.config file ?