C# Lambda expression syntax: are brackets necessary?

Posted by DevNovice on Stack Overflow See other posts from Stack Overflow or by DevNovice
Published on 2010-06-05T13:26:54Z Indexed on 2010/06/05 14:02 UTC
Read the original article Hit count: 183

Filed under:
|
|

I'm new in C# and earlier I saw the lambda expression is like

(params) => { expression;}

but in LINQ, I saw examples like

IEnumerable<string> customerFirstNames = customers.Select(cust => cust.FirstName);

No brackets.

Are they the same or is there any difference?

Thanks a lot.

© Stack Overflow or respective owner

Related posts about c#

Related posts about syntax