I have a controller Foo and an action Bar.
The only route:
routes.MapRoute(
name: "foo",
url: "foo",
defaults: new { controller = "Foo", action = "Bar" }
);
The URL localhost://foo works well;
If i change the route like this:
routes.MapRoute(
name: "foo",
url: "api/foo",
defaults: new { controller = "Foo", action = "Bar" }
);
then localhost://api/foo doesn't work.
WHY? I'm sure there's a question duplication somwhere, but i was unable to find it. Please, advice.