Expression Lambda versus Statement Lambda

前端 未结 8 929
北荒
北荒 2020-12-30 02:02

Fundamentally, is there any difference between a single-line expression lambda and a statement lambda? Take the following code, for example:

private delegate         


        
8条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 02:35

    The two are the same - the first is syntactic sugar to the second and both will compile to the same IL.

提交回复
热议问题