RouteAttribute Klasa

Definicja

Określa trasę atrybutu na kontrolerze.

public ref class RouteAttribute : Attribute, Microsoft::AspNetCore::Mvc::Routing::IRouteTemplateProvider
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class RouteAttribute : Attribute, Microsoft.AspNetCore.Mvc.Routing.IRouteTemplateProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type RouteAttribute = class
    inherit Attribute
    interface IRouteTemplateProvider
Public Class RouteAttribute
Inherits Attribute
Implements IRouteTemplateProvider
Dziedziczenie
RouteAttribute
Atrybuty
Implementuje

Konstruktory

RouteAttribute(String)

Tworzy nowy RouteAttribute przy użyciu danego szablonu trasy.

Właściwości

Name

Pobiera nazwę trasy. Nazwa trasy może służyć do generowania linku przy użyciu określonej trasy, zamiast polegać na wyborze trasy na podstawie danego zestawu wartości trasy.

Order

Pobiera kolejność tras. Kolejność określa kolejność wykonywania trasy. Najpierw są sprawdzane trasy o niższej wartości zamówienia. Jeśli akcja definiuje trasę, podając element IRouteTemplateProvider z kolejnością inną null niż kolejność, ta kolejność jest używana zamiast tej wartości. Jeśli ani akcja, ani kontroler nie definiuje kolejności, zostanie użyta wartość domyślna 0.

Template

Szablon trasy. Może to być null.

Jawne implementacje interfejsu

IRouteTemplateProvider.Order

Pobiera kolejność tras. Kolejność określa kolejność wykonywania trasy. Najpierw są sprawdzane trasy o niższej wartości zamówienia. Gdy trasa nie określi wartości, otrzymuje wartość domyślną 0. Wartość null właściwości Order oznacza, że użytkownik nie określił jawnej kolejności trasy.

Dotyczy