_=> what does this underscore mean in Lambda expressions?

Prasad picture Prasad · May 6, 2010 · Viewed 23.6k times · Source

What does an lambda expression like _=> expr mean?

What is the purpose of _ as input to lambda?

Example:

int count = 0;
list.ForEach(_ => count += 1);

Answer

ChaosPandion picture ChaosPandion · May 6, 2010

That is a convention used when you don't care about the parameter.