DotNetDynamicInjector
1.0.0
외부 프로젝트 DLL에 대한 동적 종속성 인젝터
프로젝트에 추가 할 필요없이 외부 DLL을 동적으로 참조하십시오. 비즈니스 규칙 또는 데이터베이스 매개 변수에 따라 특정 DLL을 낮추고 특정 DLL을 허용하십시오.
정보
| 코드 품질 | 짓다 | 너겟 | 기고자 |
|---|---|---|---|
플랫폼 지원
dotnet.dynamicinjector는 .NET Standard 2.0 라이브러리입니다.
DynamicInjector 사용
기본적으로 참조 해야하는 DLL은 컴파일 된 프로젝트 폴더에 있어야합니다.
ASP.NET Core 프로젝트 시작시 서비스 구성 사용
services . RegisterDynamicDependencies ( ioCConfiguration ) ;IOCConfiguration에는 종속성 주입의 구성이 포함되어 있습니다. 프로젝트의 다른 사람을 무시하고 참조하려는 네임 스페이스 만 지정할 수 있습니다.
var ioCConfiguration = new IoCConfiguration ( )
{
AllowedInterfaceNamespaces =
new List < string > { "Mynamespance1" , "Mynamespance2" }
} ;iocrole은 자동으로 주입하려는 DLL 및 종속성 유형을 구성합니다.
var role = new IoCRole
{
Dll = "MyProject.dll" , //DLL name
Implementation = "My Implementation" , // Implementation name, can be used for a control if you use several projects and wanted to separate them
Priority = 1 , // Priority that the dll should be loaded
LifeTime = LifeTime . SCOPED , // Lifetime of your addiction injection
Name = "My client business rule x" //Dependency name. It is used only for identification
} ;
ioCConfiguration . Roles . Add ( role ) ;곧 샘플이 올 것입니다 ..