Can I ignore delegate parameters with lambda syntax?

前端 未结 7 1739
野的像风
野的像风 2020-12-08 10:09

I am curious why C# allows me to ignore delegate parameters in some cases but not others.

For instance this is permitted:

Action action =          


        
7条回答
  •  一个人的身影
    2020-12-08 10:35

    I'd say it's to have a forced use of the parameters of the lambda expression.

    Take your first example, how would you interact with the passed in value, there's no local representation of it.

提交回复
热议问题