Kizspy | Question: 25
(Choose 1 answer)
In a .NET 8 Web API, what is the recommended way to handle model validation errors automatically and return a 400 Bad
Request response?
A. Manually checking ModelState.IsValid in every action.
B. The [ApiController] attribute automatically handles it.
C. Using a custom middleware to inspect every request.
D. Relying on the database to throw an exception.