-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
SlugifyParameterTransformer would not work well if specifying route attribute with curly braces {controller}/{action}
#20988
Comments
Hello! Thanks for contacting us. This sounds like a general question about using ASP.NET Core. While we try to look at and respond to all issues, for questions like this we recommend posting to a community support group like Stack Overflow with the Potential bugs in the ASP.NET Core framework and product feedback can be reported at dotnet/aspnetcore issues (include full repro steps and cross-link to a repro project in GH when appropriate). For Visual Studio, use the Report a Problem gesture or Suggest a Feature gesture within VS, which open internal issues for the VS team. For Visual Studio Code, you can open an issue at microsoft/vscode issues. |
Hi Rick, thanks for your response. Not sure if it is a potential bug. But if ASP.NET Core developers follow this doc and use curly braces with these token(s) like
|
cc @serpent5 |
The implementation shows that an |
When learning ASP.NET Core, developers tend to use consistent syntax. New developers (like myself) was introduced to use curly bracket when learning conventional routing. So I suppose it is normal that new developers tends to use curly bracket as well when comes to attribute routing (even though square bracket is also a viable option) for consistency. Is it possible to make the use of square bracket and/or curly bracket consistent across both conventional and attribute routing? |
@Rick-Anderson How do you want to proceed with this? I suggest we update the section to only mention using |
Agreed. |
In section about "Token replacement in route templates [controller], [action], [area]", we can find enclosing a token in curly braces would also be supported, like below.
It would cause that SlugifyParameterTransformer functionality not work. Using
[Route("[controller]/[action]")]
on action method, which would work well. I'd like to know why this happens. Thanks.Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: