A
A
artshelom2020-08-24 09:08:51
ASP.NET
artshelom, 2020-08-24 09:08:51

Can a controller or method be given 2 routes?

Whether it is possible to make that to the controller, to reach from 2 routes?
I mean, let's assume that from the route: /api/c1/t1 and from the route /api/c2/t1 the requests went to one method?

I use asp framework

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2020-08-24
@petermzg

So set via the Route attribute
According to the documentation

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
 public class RouteAttribute : Attribute, IRouteTemplateProvider

it supports multiple usage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question