Earlier, we serve with web service but we decide to use dll methods. Because served products are on same machine with common database. So we start to create a library with .net core. This library will be used by seperate .net applications/projects. Should we use/need dependency injection? Application itself will be have its own ui but it is not huge ui. Important part for us is serving with .dll to other projects. We don't acquire enough knowledge so decide to asking here.
In general DI should be supported in libraries. The actual implementation or selection of a DI Container should not be done by a library, that should be left to the root application.
That way the root application can decide on
- whether or not to use DI
- what DI library to use
- which other dependencies to load/pass on to the library
DI support can be implemented by providing proper interfaces and constructors that take these interfaces to receive their dependencies.