Are there any benefits to using a C# method group if available?

前端 未结 7 1098
孤街浪徒
孤街浪徒 2020-12-03 10:55

When dealing with something like a List you can write the following:

list.ForEach(x => Console.WriteLine(x));

7条回答
  •  春和景丽
    2020-12-03 11:26

    Personally I also prefer the second because it's less confusing to debug, but in this case I think it's just a matter of style since they both end up getting the same thing done.

提交回复
热议问题