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.

Use other dependency injection framework

See original GitHub issue

How can I use your WorkflowCore with a different dependency injection framework? I tried to add an extension method similar to the one you have in ServiceCollectionExtensions, but I noticed that WorkflowOptions depends on IServiceCollection. Can I somehow register workflow options with a different DI container?

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
danielgerlagcommented, Jan 13, 2019

Yeah, I don’t agree with the blog by the Simple injector guy… very much an opinion. There is a bridge for Microsoft.Extensions.DependencyInjection.Abstractions and simpleInjector… but Simple Injector is also finicky about mixing components with different lifetime scopes… not my favorite IoC container… if the basic IoC you get out of the box with .Net Core is not enough… look into Autofac.

1reaction
Kahbazicommented, Dec 20, 2018

WorkflowCore depends on Microsoft.Extensions.DependencyInjection.Abstractions and simpleInjector will not have an implementation for it, here’s the reason why. https://simpleinjector.org/blog/2016/06/whats-wrong-with-the-asp-net-core-di-abstraction/

And the integration of simpleinjector and AspNetCore is that you register your application services to simpleinjector container and simpleinjector would resolve MVC Controllers and and all the other services that are registered by Microsoft container (ex workflowCore, all the Microsoft.Extensions packages) is resolved by microsoft container, through simpleInjector Crosswire. So even if you follow the integration simpleInjector would do nothing for resolving workflowCore services.

So the only way that you can get workflowCore from simpleInjector is what @eddie3716 suggested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do we need frameworks for dependency injection?
Using a dependency injection framework helps make the program flexible and makes it easier to specify how it will operate (within well defined ......
Read more >
Dependency Injection with Code Examples
Dependency injection is a programming technique that makes a class independent of its dependencies. It achieves that by decoupling the usage of an...
Read more >
Dependency injection - .NET
Dependency injection in .NET is a built-in part of the framework, along with configuration, logging, and the options pattern. A dependency is an ......
Read more >
The Problem With Dependency Injection Frameworks
Dependency Injection Frameworks Encourage Bad Design · To replace MessageWriter with a different implementation, the Worker class must be ...
Read more >
Dependency injection
In software engineering, dependency injection is a programming technique in which an object or function receives other objects or functions that it requires ......
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