Dipper/Dipper.Alioth/Providers/StarletFeatureProvider.cs

18 lines
458 B
C#
Raw Normal View History

2022-11-27 17:23:54 +08:00
using System.Reflection;
using Microsoft.AspNetCore.Mvc.Controllers;
namespace Dipper.Alioth.Providers;
2022-11-27 18:05:18 +08:00
public class StarletFeatureProvider : ControllerFeatureProvider
2022-11-27 17:23:54 +08:00
{
protected override bool IsController(TypeInfo typeInfo)
{
if (!typeof(IStarlet).IsAssignableFrom(typeInfo) ||
!typeInfo.IsPublic ||
typeInfo.IsAbstract ||
typeInfo.IsGenericType)
return false;
return true;
}
}