I want my webapi endpoint to have a Get action without resource.
Ex: http://localhost:56155/ Resource: api/program/get, this action I want to hit when someone hit
http://localhost:56155/ in the browser. Is that possible?
I added this in webapiconfig.cs
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { controller = "Program",
action = "Get",
id = RouteParameter.Optional
}
);
But it does not redirect or hit the action Get of my Program controller when I launch the app.

Asked by
ketan Linbachiya on 13/07/2018 11:49:23 AM
Score: 269 points