Replies: 1 comment 4 replies
-
Yes your library can of course be used with MS DI. The easiest way is to simply define some composition roots in your library, make them available from outside. A consumer of your library will be able to register them in the MS DI service collection using extension methods. Another way, where you yourself will provide a collection of services from your library. Here is an example where all composition roots are added to the MS DI service collection automapically. In this case, you will need to add the Pure.DI.MS package to your library. You can also provide service providers as in the examples below, but I think this is less suitable for you. |
Beta Was this translation helpful? Give feedback.
-
If I create a library using Pure.DI for dependency injection, can it then be used in a project not using Pure.DI, but uses the traditional Dependency Injection from Microsoft?
Beta Was this translation helpful? Give feedback.
All reactions