DefaultStatusCodeAttribute Třída

Definice

Určuje výchozí stavový kód přidružený k objektu 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
Dědičnost
DefaultStatusCodeAttribute
Atributy

Poznámky

Tento atribut je pouze informativní a nemá žádné účinky za běhu. Použití atributu na třídu indikuje, že ActionResult třída reprezentovaná danou třídou používá ve výchozím nastavení konkrétní stavový kód. Použití atributu na metodu indikuje, že ActionResult metoda vrácená metodou ve výchozím nastavení používá tento stavový kód. Pozdější informace jsou užitečné ve scénářích, kdy potřebujeme určit, že metoda upraví stavový kód, který ve ActionResult výchozím nastavení používá, ve své logice, nebo pro určení stavového kódu pro použití v analyzátorech rozhraní API.

Konstruktory

DefaultStatusCodeAttribute(Int32)

Inicializuje novou instanci .DefaultStatusCodeAttribute

Vlastnosti

StatusCode

Získá výchozí stavový kód.

Platí pro