DepencyInjectionExtension
1.0.0
ห้องสมุดที่มีน้ำหนักเบาในมาตรฐาน. NET สำหรับการฉีดพึ่งพา
NUGET: https://www.nuget.org/packages/dependencyinject.extensions/
ตัวอย่าง:
[ TransientDependency ( typeof ( IService ) ) ]
public class Service : IService
{
public Service ( )
{
}
} รูปแบบ: [<AttribuleLyfeCycle>(typeof(<InterfaceType>))]
InjectAllServices ตามที่แสดงโค้ดตัวอย่าง Bellow: public void ConfigureServices ( IServiceCollection services )
{
services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
services . InjectAllServices ( ) ;
}