相关疑难解决方法(0)

将Action <T>转换为Func <T,Tres>的最佳方法是什么?

我的班上有两个带有这个签名的函数,

public static TResult Execute<TResult>(Func<T, TResult> remoteCall);
public static void Execute(Action<T> remoteCall)
Run Code Online (Sandbox Code Playgroud)

如何将第二种方法中的同一委托传递给第一种方法?使用Delegate参数创建方法不是一种方法,因为我丢失了一些异常信息非常
感谢!

.net c# delegates

19
推荐指数
2
解决办法
6264
查看次数

标签 统计

.net ×1

c# ×1

delegates ×1