Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder attribute application in HttpChain #621

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Http/Wolverine.Http/HttpChain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ public HttpChain(MethodCall method, HttpGraph parent)

DisplayName = Method.ToString();

if (method.Method.TryGetAttribute<WolverineHttpMethodAttribute>(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;
Expand All @@ -82,8 +73,17 @@ public HttpChain(MethodCall method, HttpGraph parent)
NoContent = true;
ResourceType = typeof(void);
}

Metadata = new RouteHandlerBuilder(new[] { this });

if (method.Method.TryGetAttribute<WolverineHttpMethodAttribute>(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);
Expand Down
Loading