Skip to content

Instantly share code, notes, and snippets.

@maximgorbatyuk
Created March 4, 2021 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximgorbatyuk/69d402ad2dbd819e94275a9aa069c5d7 to your computer and use it in GitHub Desktop.
Save maximgorbatyuk/69d402ad2dbd819e94275a9aa069c5d7 to your computer and use it in GitHub Desktop.
public class Startup
{
// ...
public void ConfigureServices(IServiceCollection services)
{
// ...
services
.Configure<ApiBehaviorOptions>(x =>
{
x.InvalidModelStateResponseFactory = ctx => new ValidationProblemDetailsResult();
});
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment