Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

IUrlHelper and support for RouteOptions.LowercaseUrls #7720

Closed
bugproof opened this issue Apr 30, 2018 · 5 comments
Closed

IUrlHelper and support for RouteOptions.LowercaseUrls #7720

bugproof opened this issue Apr 30, 2018 · 5 comments
Labels
3 - Done enhancement up-for-grabs Members of our awesome commnity can handle this issue
Milestone

Comments

@bugproof
Copy link

bugproof commented Apr 30, 2018

I have the following setting:

services.Configure<RouteOptions>(opt => opt.LowercaseUrls = true);

When I generate URL from my controller, query parameters are named like in C#, for example

query?Property=x

I expected it to be query?property=x, ideally in camel case. So query?propertySomething=x

It would be nice if IUrlHelper implementation or RouteValueDictionary or something else respected this setting.

Example invocation:

Url.Action(nameof(MyAction), myModel);

//myModel
class MyModel
{
    public int PropertySomething { get; set; }
}
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @enemyofthedawn.
We've moved this issue to the Backlog milestone. This means that it is not going to happen for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone May 2, 2018
@mkArtakMSFT mkArtakMSFT added enhancement 1 - Ready up-for-grabs Members of our awesome commnity can handle this issue labels May 2, 2018
@mkArtakMSFT
Copy link
Member

@enemyofthedawn, if you'd like to submit a PR in the Routing repo to handle this with a separate option, we'd be something we'd consider to take.

kishanAnem pushed a commit to kishanAnem/Routing that referenced this issue May 6, 2018
IUrlHelper and support for RouteOptions.LowercaseUrls

#issue : aspnet/Mvc#7720
kishanAnem pushed a commit to kishanAnem/Routing that referenced this issue May 19, 2018
@bugproof
Copy link
Author

bugproof commented May 24, 2018

Also it would be nice if IUrlHelper could generate hyphenated query strings, and some possibility to choose convention to use when generating links (camelcase etc.) that means some ability to support:

  • query?PropertySomething=x
  • query?propertySomething=x
  • query?property-something=x

It could be a separate option to use hyphens (boolean) or enum option to choose the convention (something like Json.NET does)

Or maybe some action so you can write your function that controls the naming.

What do you think?

kishanAnem pushed a commit to kishanAnem/Routing that referenced this issue May 31, 2018
kishanAnem pushed a commit to kishanAnem/Routing that referenced this issue Jun 1, 2018
rynowak pushed a commit to aspnet/Routing that referenced this issue Jun 1, 2018
IUrlHelper and support for RouteOptions.LowercaseUrls

#issue : aspnet/Mvc#7720
rynowak pushed a commit to aspnet/Routing that referenced this issue Jun 1, 2018
rynowak pushed a commit to aspnet/Routing that referenced this issue Jun 1, 2018
rynowak pushed a commit to aspnet/Routing that referenced this issue Jun 1, 2018
@rynowak
Copy link
Member

rynowak commented Jun 1, 2018

Fixed by acea87a

@rynowak rynowak closed this as completed Jun 1, 2018
@rynowak rynowak added 3 - Done and removed 1 - Ready labels Jun 1, 2018
@rynowak
Copy link
Member

rynowak commented Jun 1, 2018

@LeCoque - if you'd be willing to send a PR, I think we'd be willing to take something like this

Or maybe some action so you can write your function that controls the naming.

I don't want to add too many options to the framework by default - as you point out there are a lot of different schemes for generating query strings. I'd rather add a hook that lets application developers customize it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - Done enhancement up-for-grabs Members of our awesome commnity can handle this issue
Projects
None yet
Development

No branches or pull requests

3 participants