Skip to content

Commit 449abac

Browse files
authored
Add endpoint metadata to developer exception page (#52668)
1 parent 276e3fe commit 449abac

File tree

7 files changed

+882
-707
lines changed

7 files changed

+882
-707
lines changed

src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddlewareImpl.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,11 @@ private Task DisplayRuntimeException(HttpContext context, Exception ex)
320320
EndpointModel? endpointModel = null;
321321
if (endpoint != null)
322322
{
323-
endpointModel = new EndpointModel();
324-
endpointModel.DisplayName = endpoint.DisplayName;
323+
endpointModel = new EndpointModel
324+
{
325+
DisplayName = endpoint.DisplayName,
326+
Metadata = endpoint.Metadata
327+
};
325328

326329
if (endpoint is RouteEndpoint routeEndpoint)
327330
{

src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/EndpointModel.cs

Lines changed: 3 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 Microsoft.AspNetCore.Http;
5+
46
namespace Microsoft.AspNetCore.Diagnostics.RazorViews;
57

68
internal sealed class EndpointModel
@@ -9,4 +11,5 @@ internal sealed class EndpointModel
911
public string? RoutePattern { get; set; }
1012
public int? Order { get; set; }
1113
public string? HttpMethods { get; set; }
14+
public EndpointMetadataCollection? Metadata { get; set; }
1215
}

0 commit comments

Comments
 (0)