Improve XML docs for ActionResultStatusCodeAttribute (#22598)

This commit is contained in:
Scott Addie 2020-06-08 17:57:11 -05:00 committed by GitHub
parent f56cad003f
commit eee77a8f10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -6,18 +6,24 @@ using System;
namespace Microsoft.AspNetCore.Mvc.Infrastructure
{
/// <summary>
/// Attribute annoted on ActionResult constructor and helper method parameters to indicate
/// Attribute annotated on ActionResult constructor and helper method parameters to indicate
/// that the parameter is used to set the "statusCode" for the ActionResult.
/// <para>
/// 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>
/// This attribute is intentionally marked Inherited=false since the analyzer does not walk the inheritance graph.
/// </para>
/// </summary>
/// <example>
/// StatusCodeResult([ActionResultStatusCodeParameter] int statusCode)
/// Annotated constructor parameter:
/// <code>
/// public StatusCodeResult([ActionResultStatusCode] int statusCode)
/// {
/// StatusCode = statusCode;
/// }
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public sealed class ActionResultStatusCodeAttribute : Attribute