79622880

Date: 2025-05-15 08:13:02
Score: 2
Natty:
Report link

The MCV model state validation can be disabled with

var builder = WebApplication.CreateBuilder(args);
builder.services
  .ConfigureApiBehaviorOptions(options =>
  {
    options.SuppressModelStateInvalidFilter = true;
  });

See Microsoft documentation https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.apibehavioroptions.suppressmodelstateinvalidfilter?view=aspnetcore-9.0

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ArnaudB