我们什么时候应该使用 Action<T>
而不是显式定义委托(delegate)?
最佳答案
嗯...
Action<T> is almost the same as delegate void (T t)
and
Func<T> is almost the same as delegate T ()
Action 和 Func(以及 lambda)只是“语法糖”和使用委托(delegate)的便利。
所以这实际上只是一个偏好问题。
关于c# - 我们什么时候应该使用 Action<T> 而不是创建自定义委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13240503/