I am having a trouble to generate webApi Url in mvc view.
// Web API routes
config.MapHttpAttributeRoutes();
ApiController
[RoutePrefix("api/v1/bikes")]
public class bikesController : ApiController
{
[Route("", Name = "PostBike")]
public async Task<IHttpActionResult> PostBike([FromBody]Bike bike)
{
//do stuff
}
}
area registration
public override string AreaName
{
get
{
return "V1";
}
}
So the question is how to get absolute url (PostBike) in
OtherController : Controller
(its in the same area 'V1') View
I have tried many variations, and they don't work. thanks for help.