Skip to content

Add endpoint metadata to developer exception page #52668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; }
}
Loading