c# 是否有相同输入和输出类型的内置/默认委托(delegate)?像 'Transform' 委托(delegate)?

标签 c# .net delegates standard-library

这是一个非常简单的问题。我应该定义自己的委托(delegate)吗:

public delegate T Transform<T>(T input);

或者 .Net 中是否已经定义了一个标准?

最佳答案

你可以使用 Func<T, T> 为了那个原因。第一个是参数,第二个是返回值。看这里Func Delegate获取更多信息。

关于c# 是否有相同输入和输出类型的内置/默认委托(delegate)?像 'Transform' 委托(delegate)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42920634/

相关文章:

c# - Int16 - .net 中的字节容量?

c# - 使用 .NET 5 Azure Functions 中的 Content-Type multipart/form-data 从 HttpRequestData 获取 POST 参数

c# - DataGrid 虚拟化绑定(bind)到带有 GroupDescriptions 的 ListCollectionView

c# - .net/C# 的 Html 解析器和对象模型

.net - 为什么空引用异常不能命名具有空引用的对象?

c# - 检查值是否存在于 linq 中

c# - 委托(delegate)方法 - 如果我不知道参数的类型或数量,如何调用和传递参数

c# - InvokeRequired 属性的值何时更改?

ios - 如何检测 Scrollview 弹跳 - iOS

.net - Visual Studio 2010 远程调试 - 无法连接 : Access Denied