diff --git a/src/Http/Wolverine.Http/HttpChain.cs b/src/Http/Wolverine.Http/HttpChain.cs index 6430b56e0..70b9554d1 100644 --- a/src/Http/Wolverine.Http/HttpChain.cs +++ b/src/Http/Wolverine.Http/HttpChain.cs @@ -63,15 +63,6 @@ public HttpChain(MethodCall method, HttpGraph parent) DisplayName = Method.ToString(); - if (method.Method.TryGetAttribute(out var att)) - { - MapToRoute(att.HttpMethod, att.Template, att.Order); - if (att.Name.IsNotEmpty()) - { - DisplayName = att.Name; - } - } - if (tryFindResourceType(method, out var responseType)) { NoContent = false; @@ -82,8 +73,17 @@ public HttpChain(MethodCall method, HttpGraph parent) NoContent = true; ResourceType = typeof(void); } - + Metadata = new RouteHandlerBuilder(new[] { this }); + + if (method.Method.TryGetAttribute(out var att)) + { + MapToRoute(att.HttpMethod, att.Template, att.Order); + if (att.Name.IsNotEmpty()) + { + DisplayName = att.Name; + } + } // Apply attributes and the Configure() method if that exists too applyAttributesAndConfigureMethods(_parent.Rules, _parent.Container);