MvcOptions.AllowBindingHeaderValuesToNonStringModelTypes Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that determines if HeaderModelBinder should bind to types other than
String or a collection of String. If set to true
,
HeaderModelBinder would bind to simple types (like String, Int32,
Enum, Boolean etc.) or a collection of simple types. The default value of the
property is false
.
public:
property bool AllowBindingHeaderValuesToNonStringModelTypes { bool get(); void set(bool value); };
public bool AllowBindingHeaderValuesToNonStringModelTypes { get; set; }
member this.AllowBindingHeaderValuesToNonStringModelTypes : bool with get, set
Public Property AllowBindingHeaderValuesToNonStringModelTypes As Boolean
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 false
unless explicitly configured.
If the application's compatibility version is set to Version_2_1 or higher then this setting will have the value true
unless explicitly configured.