Megosztás a következőn keresztül:


MvcOptions.EnableEndpointRouting Property

Definition

Gets or sets a value that determines if routing should use endpoints internally, or if legacy routing logic should be used. Endpoint routing is used to match HTTP requests to MVC actions, and to generate URLs with IUrlHelper.

public:
 property bool EnableEndpointRouting { bool get(); void set(bool value); };
public bool EnableEndpointRouting { get; set; }
member this.EnableEndpointRouting : bool with get, set
Public Property EnableEndpointRouting As Boolean

Property Value

The default value is true.

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_1 or lower 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