ApiConventionTypeAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
要应用于包含 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 |
获取约定类型。 |
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈