You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
447 B
23 lines
447 B
namespace Connected.Middleware
|
|
{
|
|
public static class MiddlewareExtensions
|
|
{
|
|
public static List<Type> GetImplementedMiddleware(this Type type)
|
|
{
|
|
var result = new List<Type>();
|
|
var interfaces = type.GetInterfaces();
|
|
|
|
foreach (var i in interfaces)
|
|
{
|
|
if (typeof(IMiddleware).FullName is not string fullname)
|
|
continue;
|
|
|
|
if (i.GetInterface(fullname) is not null)
|
|
result.Add(i);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|