-6ren">
gpt4 book ai didi

c# - 查找所有 Func 委托(delegate)

转载 作者:行者123 更新时间:2023-11-30 20:47:21 24 4
gpt4 key购买 nike

为什么

var funcDelegatesCount = Assembly.Load("mscorlib")
.GetTypes()
.Count(t =>
t.Name.StartsWith("Func`")
&& t.BaseType == typeof(MulticastDelegate));

返回9。但实际上有17。

最佳答案

嗯。答案很有趣。

  • Func<>Func<,,,,,,,,>mscorlib组装。

  • Func<,,,,,,,,>Func<,,,,,,,,,,,,,,,,>System.Core组装。

检查:

Console.WriteLine("{0} != {1}",
typeof(Func<,,,,,,,,>).Assembly, typeof(Func<,,,,,,,,,>).Assembly);

关于c# - 查找所有 Func 委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25881732/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com