question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RouteTable.Add with DI injected presenter

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
djanosikcommented, Oct 1, 2017

The solution with presenterFactory overload feels good enough. We can add presenterType later if needed.

0reactions
quigamdevcommented, Dec 26, 2017

Solved by #514

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found