Skip to content

Commit

Permalink
Add endpoint metadata to developer exception page (#52668)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahbazi committed Mar 7, 2024
1 parent 276e3fe commit 449abac
Show file tree
Hide file tree
Showing 7 changed files with 882 additions and 707 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,11 @@ private Task DisplayRuntimeException(HttpContext context, Exception ex)
EndpointModel? endpointModel = null;
if (endpoint != null)
{
endpointModel = new EndpointModel();
endpointModel.DisplayName = endpoint.DisplayName;
endpointModel = new EndpointModel
{
DisplayName = endpoint.DisplayName,
Metadata = endpoint.Metadata
};

if (endpoint is RouteEndpoint routeEndpoint)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Http;

namespace Microsoft.AspNetCore.Diagnostics.RazorViews;

internal sealed class EndpointModel
Expand All @@ -9,4 +11,5 @@ internal sealed class EndpointModel
public string? RoutePattern { get; set; }
public int? Order { get; set; }
public string? HttpMethods { get; set; }
public EndpointMetadataCollection? Metadata { get; set; }
}

0 comments on commit 449abac

Please sign in to comment.