DepencyInjectionExtension
1.0.0
Perpustakaan ringan di standar .NET untuk injeksi ketergantungan
Nuget: https://www.nuget.org/packages/dependencyInjection.extensions/
Contoh:
[ TransientDependency ( typeof ( IService ) ) ]
public class Service : IService
{
public Service ( )
{
}
} Format: [<AttribuleLyfeCycle>(typeof(<InterfaceType>))]
InjectAllServices seperti yang ditampilkan cuplikan kode di Bellow: public void ConfigureServices ( IServiceCollection services )
{
services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
services . InjectAllServices ( ) ;
}