I want to declare multiple versions of an API inside different controllers in ASP.NET MVC. Is it possible to do something like this?
routes.MapRoute(
"Default", // Route name
"API/{version}/{action}/{id}",
new {
controller = "APIv{version}",
action = "Index",
id = UrlParameter.Optional
}
);
OR
routes.MapRoute(
"Default", // Route name
"API/{version}/{action}/{id}",
new {
controller = "APIv" + version,
action = "Index",
id = UrlParameter.Optional
}
);