ApiControllerAttribute 类

定义

指示使用类型和所有派生类型来提供 HTTP API 响应。

使用此属性修饰的控制器配置了旨在改善开发人员生成 API 体验的功能和行为。

在程序集上修饰时,程序集中的所有控制器都将被视为具有 API 行为的控制器。 有关详细信息,请参阅 ApiController 属性

public ref class ApiControllerAttribute : Microsoft::AspNetCore::Mvc::ControllerAttribute, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata, Microsoft::AspNetCore::Mvc::Internal::IApiBehaviorMetadata
public ref class ApiControllerAttribute : Microsoft::AspNetCore::Mvc::ControllerAttribute, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata
public ref class ApiControllerAttribute : Microsoft::AspNetCore::Mvc::ControllerAttribute, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata, Microsoft::AspNetCore::Mvc::Infrastructure::IApiBehaviorMetadata
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class ApiControllerAttribute : Microsoft.AspNetCore.Mvc.ControllerAttribute, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata, Microsoft.AspNetCore.Mvc.Internal.IApiBehaviorMetadata
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class ApiControllerAttribute : Microsoft.AspNetCore.Mvc.ControllerAttribute, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class ApiControllerAttribute : Microsoft.AspNetCore.Mvc.ControllerAttribute, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata, Microsoft.AspNetCore.Mvc.Infrastructure.IApiBehaviorMetadata
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type ApiControllerAttribute = class
    inherit ControllerAttribute
    interface IApiBehaviorMetadata
    interface IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type ApiControllerAttribute = class
    inherit ControllerAttribute
    interface IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type ApiControllerAttribute = class
    inherit ControllerAttribute
    interface IFilterMetadata
    interface IApiBehaviorMetadata
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type ApiControllerAttribute = class
    inherit ControllerAttribute
    interface IApiBehaviorMetadata
    interface IFilterMetadata
Public Class ApiControllerAttribute
Inherits ControllerAttribute
Implements IApiBehaviorMetadata, IFilterMetadata
Public Class ApiControllerAttribute
Inherits ControllerAttribute
Implements IFilterMetadata
继承
ApiControllerAttribute
属性
实现
IFilterMetadata Microsoft.AspNetCore.Mvc.Internal.IApiBehaviorMetadata IApiBehaviorMetadata

注解

有关详细信息,请参阅 Cookie 策略中间件

构造函数

ApiControllerAttribute()

指示使用类型和所有派生类型来提供 HTTP API 响应。

使用此属性修饰的控制器配置了旨在改善开发人员生成 API 体验的功能和行为。

在程序集上修饰时,程序集中的所有控制器都将被视为具有 API 行为的控制器。 有关详细信息,请参阅 ApiController 属性

适用于