Skip to content

Commit e7ca49c

Browse files
authored
Improve XML docs for ActionResultObjectValueAttribute (#22479)
1 parent 7043b02 commit e7ca49c

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/Mvc/Mvc.Core/src/Infrastructure/ActionResultObjectValueAttribute.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,33 @@
66
namespace Microsoft.AspNetCore.Mvc.Infrastructure
77
{
88
/// <summary>
9-
/// Attribute annoted on ActionResult constructor, helper method parameters, and properties to indicate
9+
/// Attribute annotated on ActionResult constructor, helper method parameters, and properties to indicate
1010
/// that the parameter or property is used to set the "value" for ActionResult.
1111
/// <para>
1212
/// Analyzers match this parameter by type name. This allows users to annotate custom results \ custom helpers
13-
/// with a user defined attribute without having to expose this type.
13+
/// with a user-defined attribute without having to expose this type.
1414
/// </para>
1515
/// <para>
1616
/// This attribute is intentionally marked Inherited=false since the analyzer does not walk the inheritance graph.
1717
/// </para>
1818
/// </summary>
1919
/// <example>
20-
/// BadObjectResult([ActionResultObjectValueAttribute] object value)
21-
/// ObjectResult { [ActionResultObjectValueAttribute] public object Value { get; set; } }
20+
/// Annotated constructor parameter:
21+
/// <code>
22+
/// public BadRequestObjectResult([ActionResultObjectValue] object error)
23+
/// :base(error)
24+
/// {
25+
/// StatusCode = DefaultStatusCode;
26+
/// }
27+
/// </code>
28+
/// Annotated property:
29+
/// <code>
30+
/// public class ObjectResult : ActionResult, IStatusCodeActionResult
31+
/// {
32+
/// [ActionResultObjectValue]
33+
/// public object Value { get; set; }
34+
/// }
35+
/// </code>
2236
/// </example>
2337
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
2438
public sealed class ActionResultObjectValueAttribute : Attribute

0 commit comments

Comments
 (0)