Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The name of the => operator in C# [duplicate]

Tags:

c#

linq

Possible Duplicate:
What is the => token called?

Hey,

In LINQ what is the name of the => operator e.g:

list.Where(a => a.value == 5);
like image 660
Luke Belbina Avatar asked Nov 04 '10 22:11

Luke Belbina


2 Answers

It's called the lambda operator and is pronounced "goes to".

From here.

like image 56
Michael Todd Avatar answered Sep 17 '22 13:09

Michael Todd


It's the lambda operator. Or at least, an expression of the form

x => y

(or any of the longer forms involving =>) is a lambda expression. (I don't personally tend to think of it as an operator as such, even though the linked page refers to the lambda operator. The C# 4 spec doesn't contain the phrase "lambda operator" anywhere.)

like image 33
Jon Skeet Avatar answered Sep 20 '22 13:09

Jon Skeet