This commit is contained in:
2025-08-22 11:55:35 +01:00
commit b21d2a685e
312 changed files with 31174 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc.Controllers;
using System.Reflection;
using Microsoft.Extensions.Logging;
namespace MareSynchronosShared.Utils;
public class AllowedControllersFeatureProvider : ControllerFeatureProvider
{
private readonly ILogger _logger;
private readonly Type[] _allowedTypes;
public AllowedControllersFeatureProvider(params Type[] allowedTypes)
{
_allowedTypes = allowedTypes;
}
protected override bool IsController(TypeInfo typeInfo)
{
return base.IsController(typeInfo) && _allowedTypes.Contains(typeInfo.AsType());
}
}