Improve XML docs for ActionResultObjectValueAttribute (#22479)
This commit is contained in:
parent
7043b022b4
commit
e7ca49c95e
|
|
@ -6,19 +6,33 @@ using System;
|
||||||
namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attribute annoted on ActionResult constructor, helper method parameters, and properties to indicate
|
/// Attribute annotated on ActionResult constructor, helper method parameters, and properties to indicate
|
||||||
/// that the parameter or property is used to set the "value" for ActionResult.
|
/// that the parameter or property is used to set the "value" for ActionResult.
|
||||||
/// <para>
|
/// <para>
|
||||||
/// Analyzers match this parameter by type name. This allows users to annotate custom results \ custom helpers
|
/// Analyzers match this parameter by type name. This allows users to annotate custom results \ custom helpers
|
||||||
/// with a user defined attribute without having to expose this type.
|
/// with a user-defined attribute without having to expose this type.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// This attribute is intentionally marked Inherited=false since the analyzer does not walk the inheritance graph.
|
/// This attribute is intentionally marked Inherited=false since the analyzer does not walk the inheritance graph.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <example>
|
/// <example>
|
||||||
/// BadObjectResult([ActionResultObjectValueAttribute] object value)
|
/// Annotated constructor parameter:
|
||||||
/// ObjectResult { [ActionResultObjectValueAttribute] public object Value { get; set; } }
|
/// <code>
|
||||||
|
/// public BadRequestObjectResult([ActionResultObjectValue] object error)
|
||||||
|
/// :base(error)
|
||||||
|
/// {
|
||||||
|
/// StatusCode = DefaultStatusCode;
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// Annotated property:
|
||||||
|
/// <code>
|
||||||
|
/// public class ObjectResult : ActionResult, IStatusCodeActionResult
|
||||||
|
/// {
|
||||||
|
/// [ActionResultObjectValue]
|
||||||
|
/// public object Value { get; set; }
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
/// </example>
|
/// </example>
|
||||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
|
||||||
public sealed class ActionResultObjectValueAttribute : Attribute
|
public sealed class ActionResultObjectValueAttribute : Attribute
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue