diff options
author | crupest <crupest@outlook.com> | 2020-05-30 23:16:49 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-05-30 23:16:49 +0800 |
commit | 2ffc07756ca7d50533e90fdac37d62a6c33a8a00 (patch) | |
tree | 88d142853805b6b5a0230164f19ae35e425ea559 /Timeline/Routes/ApiRoutePrefixConvention.cs | |
parent | 68ca8b0976efe90c0c40bcae69f0825671b98bad (diff) | |
download | timeline-2ffc07756ca7d50533e90fdac37d62a6c33a8a00.tar.gz timeline-2ffc07756ca7d50533e90fdac37d62a6c33a8a00.tar.bz2 timeline-2ffc07756ca7d50533e90fdac37d62a6c33a8a00.zip |
Just get everything works!
Diffstat (limited to 'Timeline/Routes/ApiRoutePrefixConvention.cs')
-rw-r--r-- | Timeline/Routes/ApiRoutePrefixConvention.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Timeline/Routes/ApiRoutePrefixConvention.cs b/Timeline/Routes/ApiRoutePrefixConvention.cs index 2653c2ca..ca38a0d9 100644 --- a/Timeline/Routes/ApiRoutePrefixConvention.cs +++ b/Timeline/Routes/ApiRoutePrefixConvention.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
+using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Routing;
using System.Linq;
@@ -29,7 +30,7 @@ namespace Timeline.Routes public void Apply(ApplicationModel application)
{
- foreach (var selector in application.Controllers.Where(c => c.RouteValues.TryGetValue("area", out var value) && value == "api").SelectMany(c => c.Selectors))
+ foreach (var selector in application.Controllers.Where(c => c.Filters.Any(f => f is IApiBehaviorMetadata)).SelectMany(c => c.Selectors))
{
if (selector.AttributeRouteModel != null)
{
|