-
Notifications
You must be signed in to change notification settings - Fork 10.7k
[Suggestion] Make DefaultLinkGenerator public and non sealed #25121
Copy link
Copy link
Open
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-routinginvestigateseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-routinginvestigateseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for Feature.
Hi everyone,
I'd like to localize URLs of my application and, in order to do that, my solution is to translate route values for
actionandcontrollerbefore they're actually processed by theDefaultLinkGenerator. This is what I'd like to do:Since I don't want to change the default url generation logic, I thought this was a simple and effective solution.
It's not viable though, since the
DefaultLinkGeneratoris aprivate sealedclass.Is there a particular reason why it cannot be a normal, overridable public class?
The fact it's a
private sealedclass did not stop me from achieving this solution, in fact I just had to wrap theDefaultLinkGeneratorwith my own implementation. It works but it's way uglier.In Startup.ConfigureServices:
Would you please consider to make the
DefaultLinkGeneratorpublic and non-sealed?Thanks.
P.S. Overall, I've found maaaany obstacles when trying to localize URLs. Another is in issue #16965. It's almost like you didn't even consider people might want to do it.