C# – How to disable ModelStateInvalidFilter

There are two options for disabling ModelStateInvalidFilter: You’d do this when you want to manually perform model validation. I’ll show both options below. Disable ModelStateInvalidFilter globally To disable ModelStateInvalidFilter for *all* actions, set SuppressModelStateInvalidFilter=true in ConfigureApiBehaviorOptions, like this: Disable ModelStateInvalidFilter for specific actions To disable ModelStateInvalidFilter selectively, you can implement an IActionModelConvention attribute that removes … Read more