📜  c# 按命名空间获取所有类 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:45.893000             🧑  作者: Mango

代码示例1
using System.Reflection;
private Type[] GetTypesInNamespace(Assembly assembly, string nameSpace)
{
    return 
      assembly.GetTypes()
              .Where(t => String.Equals(t.Namespace, nameSpace, StringComparison.Ordinal))
              .ToArray();
}