ActionResultObjectValueAttribute Třída

Definice

Atribut označený konstruktorem ActionResult, pomocnými parametry metody a vlastnostmi označující, že parametr nebo vlastnost se používá k nastavení hodnoty pro ActionResult.

Analyzátory odpovídají tomuto parametru podle názvu typu. To umožňuje uživatelům přidat poznámky k vlastním výsledkům \ vlastní pomocné rutiny s uživatelsky definovaným atributem, aniž by museli tento typ vystavit.

Tento atribut je záměrně označen zděděný=false, protože analyzátor neprovádí graf dědičnosti.

public ref class ActionResultObjectValueAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)]
public sealed class ActionResultObjectValueAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)>]
type ActionResultObjectValueAttribute = class
    inherit Attribute
Public NotInheritable Class ActionResultObjectValueAttribute
Inherits Attribute
Dědičnost
ActionResultObjectValueAttribute
Atributy

Příklady

Parametr konstruktoru s poznámkami:

public BadRequestObjectResult([ActionResultObjectValue] object error)
    :base(error)
{
    StatusCode = DefaultStatusCode;
}
        Vlastnost s poznámkami:
public class ObjectResult : ActionResult, IStatusCodeActionResult
{
    [ActionResultObjectValue]
    public object Value { get; set; }
}

Konstruktory

ActionResultObjectValueAttribute()

Platí pro