DefaultStatusCodeAttribute クラス

定義

に関連付けられている既定の状態コードを ActionResult指定します。

public ref class DefaultStatusCodeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public sealed class DefaultStatusCodeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public sealed class DefaultStatusCodeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type DefaultStatusCodeAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type DefaultStatusCodeAttribute = class
    inherit Attribute
Public NotInheritable Class DefaultStatusCodeAttribute
Inherits Attribute
継承
DefaultStatusCodeAttribute
属性

注釈

この属性は情報提供のみを行い、ランタイム効果はありません。 クラスに 属性を適用すると、そのクラスで表される が ActionResult 既定で特定の状態コードを使用することを示します。 メソッドに 属性を適用すると、メソッドによって返される が既定でその状態コードを使用することを ActionResult 示します。 以降は、メソッドがロジックで既定で使用する状態コードを変更するか、API アナライザーで使用する状態コードを指定する必要がある ActionResult シナリオで役立ちます。

コンストラクター

DefaultStatusCodeAttribute(Int32)

DefaultStatusCodeAttribute の新しいインスタンスを初期化します。

プロパティ

StatusCode

既定の状態コードを取得します。

適用対象