DepencyInjectionExtension
1.0.0
Легкая библиотека в стандарте .NET для инъекции зависимости
Nuget: https://www.nuget.org/packages/dependencyinction.extensions/
Пример:
[ TransientDependency ( typeof ( IService ) ) ]
public class Service : IService
{
public Service ( )
{
}
} Формат: [<AttribuleLyfeCycle>(typeof(<InterfaceType>))]
InjectAllServices как показано, что фрагмент кода реже: public void ConfigureServices ( IServiceCollection services )
{
services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
services . InjectAllServices ( ) ;
}