Multiple route attributes
See original GitHub issueHello, I’m trying this library for the first time, I immediately ran into this limit Duplicate 'HttpGet' attribute
while the asp.net core controllers allow it
[HttpGet("/api/session/me")]
[HttpGet("/api/session/")] // <--- Duplicate 'HttpGet' attribute
[AllowAnonymous]
public class SessionEndpoint : Endpoint<EmptyRequest, CurrentSessionResponse>
{
public override async Task HandleAsync(EmptyRequest request, CancellationToken cancellationToken)
{
var response = new CurrentSessionResponse
{
...
};
await SendAsync(response, cancellation: cancellationToken).ConfigureAwait(false);
}
}
is this a feature that will be supported?
thanks
Issue Analytics
- State:
- Created a year ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
asp.net - Assigning multiple routes to the same controller or ...
Having 2 route attributes at the controller level works fine in a new RC1 application: [Produces("application/json")] ...
Read more >Multiple Routes - Mastering ASP.NET Web API [Book]
Run the application to see the multiple routes in action. You would verify the multiple routes are working by accessing the endpoints on...
Read more >Routing to controller actions in ASP.NET Core
Attribute routing provides fine-grained control to make the ID required for some actions and not for others. By convention, the documentation ...
Read more >Route Attribute In ASP.NET MVC
In this article I explain the basic usage of route attribute and how ... You can also write multiple routes onthe same action...
Read more >Web API Routing
Learn about Web API routing here. Web API supports two types of routing: Convention-based Routing and Attribute Routing.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks good and simple to understand!
it’s currently not supported atm with attributes. but available via routes() method as shown here: https://github.com/dj-nitehawk/FastEndpoints/blob/1c1ac25cd0f4e9e70c952f0f51cbb658271f6905/Web/[Features]/Customers/Create/Endpoint.cs#L39-L42
will look into supporting it in the future.