Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:36:07+00:00 2026-06-08T12:36:07+00:00

What is Significance of using lambda expressions. like in C# there foreach loop which

  • 0

What is Significance of using lambda expressions.

like in C# there foreach loop which might take 3-4 line for assigning values

using lamba

List.foreach(x=>x.something = new value) 

I would like to know more on lambda and more advance uses of it in C#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:36:08+00:00Added an answer on June 8, 2026 at 12:36 pm

    A lambda expression is more a less a short hand syntax for a method.

    Take the following lambda expression:

    p => p.FullName
    

    This is equivalent to:

    string getFullName(Person p)
    {
        return p.FullName;
    }
    

    Its usage allows you to create anonymous functions. So a method that would take a delegate would be defined as:

    public delegate string FullNameDelegate(Person p);
    public void DoSomething(FullNameDelegate getter)
    {
       Person p = new Person();
       string fullname = getter(p);
    }
    public string GetFullName(Person p)
    {
        return p.FullName;
    }
    
    DoSomething(new FullNameDelegate(GetFullName));
    

    The lambda equivalent would be:

    public void DoSomething(Func<Person, string> getter)
    {
       Person p = new Person();
       string fullname = getter(p);
    }
    
    DoSomething(p => p.FullName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Besides readability is there any significant benifit to using a CASE WHEN statement vs
Is there significant problem, if I write the code for embedded linux system using
Is there any significance in the order of table in sql join statement. For
I have a program which writes its output using ofstream. Everything works perfectly fine
I have detailed US county maps, from the TIGER LINE data sets. How might
I need to profile the performance of an application for which I am using
I was wondering what's the significance of using the lang attribute and how that
In the past, when I've needed array-like indexical lookups in a tight loop, I
Can someone post me the significance of -z option while writing if condition using
I see locking using static readonly objects alot, what is the significance of this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.