Convert null-valued results to 404 in ASP.NET Core MVC

added by DotNetKicks
10/5/2018 12:29:43 PM

2 Kicks, 116 Views

ASP.NET Core MVC is pretty flexible in terms of how it expects you to return results from the API actions. You could return an IActionResult, which gives you certain control over the status code and the nature of the response (i.e. object or a file or a status code only and so on).