ApiConventionTypeAttribute Klasa

Definicja

Konwencje interfejsu API, które mają być stosowane do zestawu zawierającego kontrolery MVC lub jeden kontroler.

Konwencje interfejsu API są używane do wpływania na dane wyjściowe interfejsu APIExplorer. Konwencje muszą być typami statycznymi. Metody w konwencji są dopasowywane do metody akcji przy użyciu reguł określonych przez ApiConventionNameMatchAttribute , które mogą być stosowane do nazwy metody lub jej parametrów i ApiConventionTypeMatchAttribute które są stosowane do parametrów.

Jeśli nie znaleziono atrybutów określających zachowanie, mvc pasuje do nazw metod i nazw parametrów są dopasowywane przy użyciu , a typy parametrów są dopasowywane przy użyciu Exact polecenia AssignableFrom.

public ref class ApiConventionTypeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ApiConventionTypeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ApiConventionTypeAttribute = class
    inherit Attribute
Public NotInheritable Class ApiConventionTypeAttribute
Inherits Attribute
Dziedziczenie
ApiConventionTypeAttribute
Atrybuty

Konstruktory

ApiConventionTypeAttribute(Type)

Inicjuje ApiConventionTypeAttribute wystąpienie przy użyciu polecenia conventionType.

Właściwości

ConventionType

Pobiera typ konwencji.

Dotyczy