Description: .NET development from Tauranga
In ASP.NET 6, the standard way to return a 404 from a Controller action is with
return NotFound(); And if you want to return a message with it, you can do
Couldn't find an account with id 123. Which isn’t ideal. Ideally we want to return a ProblemDetails like a nice API should. I found this workaround: