您可以将以下委托转换为使用lambda表达式吗?
public Action<int, Func<int, int>> DisplayResult = delegate (int result, Func<int, int> function)
{
Console.WriteLine(function(result));
};
我已经尝试删除所有数据类型等,但它没有用完
答案 0 :(得分:2)
public Action<int, Func<int, int>> DisplayResult = (result, function) =>
{
Console.WriteLine(function(result));
};