C# 获取指定接口的所有实现类

时间:2025-03-21 20:07:25
   var types = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(a => a.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(InterfaceName))))
.ToArray();

相关文章