I am in need of migrating from normal MVC
controller to WebApi
controller.
My normal mvc controller.
[HttpPost]
[ValidateInput(false)]
public ActionResult Validate(string data)
{
}
WebApi Controller
[HttpPost]
[ValidateInput(false)]
// the moment I resolve the namespace System.Web.Mvc all the [HttpPost],[HttpGet] starts throwing error.
public HttpStatusCode Post([FromBody]string data)
{
}
Can somebody explain why so & how to address this requirement?