ApiConventionTypeAttribute 類別

定義

要套用至包含 MVC 控制器或單一控制器之元件的 API 慣例。

API 慣例可用來影響 ApiExplorer 的輸出。 慣例必須是靜態類型。 慣例中的方法會使用 指定的 ApiConventionNameMatchAttribute 規則,比對動作方法,這些規則可以套用至方法名稱或其參數,以及 ApiConventionTypeMatchAttribute 套用至參數。

找不到指定行為的屬性時,MVC 會使用 Exact 比對方法名稱和參數名稱,並使用 比 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
繼承
ApiConventionTypeAttribute
屬性

建構函式

ApiConventionTypeAttribute(Type)

ApiConventionTypeAttribute使用 conventionType 初始化 實例。

屬性

ConventionType

取得慣例類型。

適用於