DepencyInjectionExtension
1.0.0
مكتبة خفيفة الوزن في .NET Standard لحقن التبعية
nuget: https://www.nuget.org/packages/dependencyinjection.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 ( ) ;
}