Add StringSyntax
to the RouteAttribute
by IEvangelist · Pull Request #57369 · dotnet/aspnetcore (original) (raw)
Add StringSyntax
to the RouteAttribute
- You've read the Contributor Guide and Code of Conduct.
You've included unit or integration tests for your change, where applicable.You've included inline docs for your change, where applicable.- There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
Consistent syntax highlighting of template/patterns for routes.
Description
I noticed when using the [Route("/orders/{orderId:int}")]
attribute, as an example, doesn't display the same as when using the EndpointRouteBuilderExtensions
APIs for Map*
that accept a template/pattern.
Example MapGet
— includes string syntax:
Example Route
— doesn't include string syntax:
I think it would be great if we could also highlight routes when using the attribute. This PR adds the StringSyntax
to decorate the template
parameter to be highlighted like the method APIs.
Contributes to #44535