Skip to content

Commit c89dad3

Browse files
committed
PR feedback and clean up
1 parent 4ecd411 commit c89dad3

12 files changed

+27
-8
lines changed

src/Http/Http.Extensions/src/DisableHttpMetricsAttribute.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Diagnostics;
45
using Microsoft.AspNetCore.Http.Metadata;
56

67
namespace Microsoft.AspNetCore.Http;
@@ -9,6 +10,12 @@ namespace Microsoft.AspNetCore.Http;
910
/// Specifies that HTTP request duration metrics is disabled for an endpoint.
1011
/// </summary>
1112
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
13+
[DebuggerDisplay("{ToString(),nq}")]
1214
public sealed class DisableHttpMetricsAttribute : Attribute, IDisableHttpMetricsMetadata
1315
{
16+
/// <inheritdoc/>
17+
public override string ToString()
18+
{
19+
return "DisableHttpMetrics";
20+
}
1421
}

src/Http/Http.Extensions/src/EndpointDescriptionAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public EndpointDescriptionAttribute(string description)
2929
/// <inheritdoc />
3030
public string Description { get; }
3131

32-
/// <inheritdoc/>>
32+
/// <inheritdoc/>
3333
public override string ToString()
3434
{
3535
return $"Description: {Description ?? "(null)"}";

src/Http/Http.Extensions/src/EndpointSummaryAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public EndpointSummaryAttribute(string summary)
2626
/// <inheritdoc />
2727
public string Summary { get; }
2828

29-
/// <inheritdoc/>>
29+
/// <inheritdoc/>
3030
public override string ToString()
3131
{
3232
return DebuggerHelpers.GetDebugText(nameof(Summary), Summary);

src/Http/Http.Extensions/src/HttpMetricsEndpointConventionBuilderExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace Microsoft.AspNetCore.Builder;
1010
/// </summary>
1111
public static class HttpMetricsEndpointConventionBuilderExtensions
1212
{
13+
private static readonly DisableHttpMetricsAttribute _disableHttpMetricsAttribute = new DisableHttpMetricsAttribute();
14+
1315
/// <summary>
1416
/// Specifies that HTTP request duration metrics is disabled for an endpoint.
1517
/// </summary>
@@ -18,7 +20,7 @@ public static class HttpMetricsEndpointConventionBuilderExtensions
1820
/// <returns>The original convention builder parameter.</returns>
1921
public static TBuilder DisableHttpMetrics<TBuilder>(this TBuilder builder) where TBuilder : IEndpointConventionBuilder
2022
{
21-
builder.Add(b => b.Metadata.Add(new DisableHttpMetricsAttribute()));
23+
builder.Add(b => b.Metadata.Add(_disableHttpMetricsAttribute));
2224
return builder;
2325
}
2426
}

src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Microsoft.AspNetCore.Http.HttpValidationProblemDetails.HttpValidationProblemDeta
33
Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions
44
Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute
55
Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute.DisableHttpMetricsAttribute() -> void
6+
override Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute.ToString() -> string!
67
static Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions.DisableHttpMetrics<TBuilder>(this TBuilder builder) -> TBuilder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
#nullable enable
2+
override Microsoft.AspNetCore.Http.Timeouts.DisableRequestTimeoutAttribute.ToString() -> string!

src/Http/Http/src/Timeouts/DisableRequestTimeoutAttribute.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Diagnostics;
5+
46
namespace Microsoft.AspNetCore.Http.Timeouts;
57

68
/// <summary>
@@ -10,6 +12,12 @@ namespace Microsoft.AspNetCore.Http.Timeouts;
1012
/// Completely disables the request timeouts middleware from applying to this endpoint.
1113
/// </remarks>
1214
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
15+
[DebuggerDisplay("{ToString(),nq}")]
1316
public sealed class DisableRequestTimeoutAttribute : Attribute
1417
{
18+
/// <inheritdoc/>
19+
public override string ToString()
20+
{
21+
return "DisableRequestTimeout";
22+
}
1523
}

src/Http/Routing/src/ExcludeFromDescriptionAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public sealed class ExcludeFromDescriptionAttribute : Attribute, IExcludeFromDes
1717
/// <inheritdoc />
1818
public bool ExcludeFromDescription => true;
1919

20-
/// <inheritdoc/>>
20+
/// <inheritdoc/>
2121
public override string ToString()
2222
{
2323
return DebuggerHelpers.GetDebugText(nameof(ExcludeFromDescription), ExcludeFromDescription);

src/Middleware/CORS/src/DisableCorsAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Cors;
1111
[DebuggerDisplay("{ToString(),nq}")]
1212
public class DisableCorsAttribute : Attribute, IDisableCorsAttribute
1313
{
14-
/// <inheritdoc/>>
14+
/// <inheritdoc/>
1515
public override string ToString()
1616
{
1717
return "CORS Disable";

src/Middleware/CORS/src/EnableCorsAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public EnableCorsAttribute(string? policyName)
3333
/// <inheritdoc />
3434
public string? PolicyName { get; set; }
3535

36-
/// <inheritdoc/>>
36+
/// <inheritdoc/>
3737
public override string ToString()
3838
{
3939
return DebuggerHelpers.GetDebugText(nameof(PolicyName), PolicyName, prefix: "CORS");

src/Security/Authorization/Core/src/AllowAnonymousAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Authorization;
1313
[DebuggerDisplay("{ToString(),nq}")]
1414
public class AllowAnonymousAttribute : Attribute, IAllowAnonymous
1515
{
16-
/// <inheritdoc/>>
16+
/// <inheritdoc/>
1717
public override string ToString()
1818
{
1919
return "AllowAnonymous";

src/Security/Authorization/Core/src/AuthorizeAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public AuthorizeAttribute(string policy)
4343
/// </summary>
4444
public string? AuthenticationSchemes { get; set; }
4545

46-
/// <inheritdoc/>>
46+
/// <inheritdoc/>
4747
public override string ToString()
4848
{
4949
return DebuggerHelpers.GetDebugText(nameof(Policy), Policy, nameof(Roles), Roles, nameof(AuthenticationSchemes), AuthenticationSchemes, includeNullValues: false, prefix: "Authorize");

0 commit comments

Comments
 (0)