Is there a case where delegate syntax is preferred over lambda expression for anonymous methods?

前端 未结 7 1519
别跟我提以往
别跟我提以往 2021-02-07 21:13

With the advent of new features like lambda expressions (inline code), does it mean we dont have to use delegates or anonymous methods anymore? In almost all the samples I have

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 21:51

    Lambda expressions are just "syntactic sugar", the compiler will generate appropriate delegates for you. You can investigate this by using Lutz Roeder's Reflector.

提交回复
热议问题