I am trying to create an MVC link via Url.Action inside my Web API Controller
string scheme = Request.RequestUri.Scheme;
System.Web.Mvc.UrlHelper helper = new System.Web.Mvc.UrlHelper();
string linkBackUrl = helper.Action("TestAction", "TestController", new{ code=code1, code2 = code2}, scheme);
And I am getting the error (when debugging) on the line linkBackUrl:
attempted to read or write protected memory. this is often an indication that other memory is corrupt.
Is there another way to create the linkBackUrl inside the Web API controller?
ApiController--it comes with one