With MinimalApi you can register MetaData with the route like below.
app.MapGet("test-slow-route", async () => { await Task.Delay(1000); return Results.Ok("Ok"); })
.WithMetadata(new SystemAccessRoute());
and then query this from the endpoint
var endpoint = context.GetEndpoint();
return endpoint.Metadata.GetMetadata<SystemAccessRoute>() != null;
How do you add metadata to a razor page that can be discovered in middleware or really anywhere with a HttpContext
?