Using a lambda expression versus a private method

前端 未结 7 1137
北海茫月
北海茫月 2021-02-02 13:42

I read an answer to a question on Stack Overflow that contained the following suggested code:

Action logAndEat = ex => 
{  
    // Log Error          


        
7条回答
  •  遥遥无期
    2021-02-02 14:13

    IMO I don't like tiny little private functions that are only used in another private method wondering around my classes I just find them ugly, that's why I'd use the lambda in that sample

    I don't think there's gonna be a performance impact in using the lambda instead of a function

提交回复
热议问题