Tidy conversion to aspnetcore

(cherry picked from commit 490f6e2e6aa3f220cc98f257a3ca3b2bea48fb80)
This commit is contained in:
ta264
2021-04-20 21:21:42 +01:00
parent 47b23417e0
commit 8f3f90d407
4 changed files with 7 additions and 23 deletions

View File

@@ -1,21 +1,15 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Routing;
namespace NzbDrone.Http.REST.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class RestGetByIdAttribute : ActionFilterAttribute, IActionHttpMethodProvider, IRouteTemplateProvider
public class RestGetByIdAttribute : Attribute, IActionHttpMethodProvider, IRouteTemplateProvider
{
public override void OnActionExecuting(ActionExecutingContext context)
{
Console.WriteLine($"OnExecuting {context.Controller.GetType()} {context.ActionDescriptor.DisplayName}");
}
public IEnumerable<string> HttpMethods => new[] { "GET" };
public string Template => "{id:int}";
public new int? Order => 0;
public int? Order => 0;
public string Name { get; }
}
}