ApiConventionTypeAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
要应用于包含 MVC 控制器或单个控制器的程序集的 API 约定。
API 约定用于影响 ApiExplorer 的输出。 约定必须是静态类型。 约定中的方法与操作方法匹配,方法是使用可应用于方法名称或其参数ApiConventionTypeMatchAttribute以及应用于参数的规则指定的ApiConventionNameMatchAttribute操作方法。
如果未找到指定行为的属性,则 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 |
获取约定类型。 |