MvcOptions.InputFormatterExceptionPolicy Property

Definition

Gets or sets a value which determines how the model binding system interprets exceptions thrown by an IInputFormatter. The default value of the property is AllExceptions.

public:
 property Microsoft::AspNetCore::Mvc::Formatters::InputFormatterExceptionPolicy InputFormatterExceptionPolicy { Microsoft::AspNetCore::Mvc::Formatters::InputFormatterExceptionPolicy get(); void set(Microsoft::AspNetCore::Mvc::Formatters::InputFormatterExceptionPolicy value); };
public Microsoft.AspNetCore.Mvc.Formatters.InputFormatterExceptionPolicy InputFormatterExceptionPolicy { get; set; }
member this.InputFormatterExceptionPolicy : Microsoft.AspNetCore.Mvc.Formatters.InputFormatterExceptionPolicy with get, set
Public Property InputFormatterExceptionPolicy As InputFormatterExceptionPolicy

Property Value

Remarks

This property is associated with a compatibility switch and can provide a different behavior depending on the configured compatibility version for the application. See CompatibilityVersion for guidance and examples of setting the application's compatibility version.

Configuring the desired value of the compatibility switch by calling this property's setter will take precedence over the value implied by the application's CompatibilityVersion.

If the application's compatibility version is set to Version_2_0 then this setting will have the value AllExceptions unless explicitly configured.

If the application's compatibility version is set to Version_2_1 or higher then this setting will have the value MalformedInputExceptions unless explicitly configured.

Applies to