Share via


MvcDataAnnotationsLocalizationOptions.AllowDataAnnotationsLocalizationForEnumDisplayAttributes Property

Definition

Gets or sets a value that determines if DataAnnotationLocalizerProvider should be used while localizing Enum types. If set to trueDataAnnotationLocalizerProvider will be used in localizing Enum types. If set to false the localization will search for values in resource files for the Enum.

public:
 property bool AllowDataAnnotationsLocalizationForEnumDisplayAttributes { bool get(); void set(bool value); };
public bool AllowDataAnnotationsLocalizationForEnumDisplayAttributes { get; set; }
member this.AllowDataAnnotationsLocalizationForEnumDisplayAttributes : bool with get, set
Public Property AllowDataAnnotationsLocalizationForEnumDisplayAttributes 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 or Version_2_1 then this setting will have the value false unless explicitly configured.

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

Applies to