What is lambda expressions in C#?
What is lambda expressions in C#?
Lambda expressions in C# are anonymous functions that can be used to create delegates or expression tree types. They provide a concise syntax for defining methods without explicitly declaring a named method[1][2][3].
The syntax for a lambda expression is:
(input-parameters) => expression
or
(input-parameters) => { <sequence-of-statements> }
The left side specifies the input parameters (if any) and the right side is the expression or statement block[4].
Some key points about lambda expressions:
Func
or Action
based on the parameter and return types[4]middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào