2022-11-06 22:42:32 +08:00
|
|
|
using System.Reflection;
|
2022-11-27 17:23:54 +08:00
|
|
|
using Dipper.Alioth.Starlets;
|
2022-11-06 22:42:32 +08:00
|
|
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
|
|
|
|
|
|
|
namespace Dipper.Alioth.Web;
|
|
|
|
|
2022-11-27 17:36:19 +08:00
|
|
|
public class StarletFeatureProvider : ControllerFeatureProvider
|
2022-11-06 22:42:32 +08:00
|
|
|
{
|
|
|
|
protected override bool IsController(TypeInfo typeInfo)
|
|
|
|
{
|
2022-11-27 17:23:54 +08:00
|
|
|
return typeof(IStarlet).IsAssignableFrom(typeInfo) && typeInfo.IsPublic
|
2022-11-06 22:42:32 +08:00
|
|
|
&& !typeInfo.IsAbstract && !typeInfo.IsGenericType;
|
|
|
|
}
|
|
|
|
}
|