RouteTable.Add with DI injected presenter
See original GitHub issueThe RouteTable.Add
method has a presenterFactory
parameter, that can be used for creating a custom presenter, but it can’t easily come from DI as there is no IServiceProvider
parameter. I think that we should add an overload that would allow that. The presenter injection could then look like:
routes.Add(..., presenterFactory: ServiceProviderServiceExtensions.GetRequiredService<SomePresenter>)
Do you think that it’s enough, or one more overload with something like presenterType: Type
would be useful?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Change route collection of MVC6 after startup
I wish to do the same in MVC-6 so I can add/delete routes during runtime (usefull for CMS). The code to do it...
Read more >Routing in ASP.NET Core
Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app's executable endpoints.
Read more >VPC construct should allow using custom route table for ...
Currently it's not possible to specify either the number of route tables or inject a custom route table to the VPC construct.
Read more >Web API Routing
Routes is a route table or route collection of type HttpRouteCollection. The "DefaultApi" route is added in the route table using MapHttpRoute() extension ......
Read more >Dependency Injection with a WCF Service - Productive Rage
This returns a class that inherits from ServiceHost which registers a "Instance Provider" that will be used to instantiate the actual Service ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The solution with
presenterFactory
overload feels good enough. We can addpresenterType
later if needed.Solved by #514