How to return Json result with 404 status code
I am using ASP.NET Web API 2 and I want to return a json result from my API with the error code 404. I am trying to mimic this result: This is what I have tried: [RoutePrefix("error")] public class ErrorController…