依赖注入 批量注册
public static Dictionary<Type, Type[]> NewGetImpleAndInterfaces(string assemblyName, string suffix)
{
if (!String.IsNullOrEmpty(assemblyName))
{
var result = new Dictionary<Type, Type[]>();
foreach (var item in Assembly.Load(assemblyName)
.GetTypes()
.Where(x => !x.IsInterface && x.Name.Contains(suffix) && !x.IsGenericType)
.ToList())
{
result.Add(item, item.GetInterfaces());
}
return result;
}
return new Dictionary<Type, Type[]>();
}
求人不如求己,大哥就是自己