Пример #1
0
 public static IServiceCollection BatchInject(
     this IServiceCollection services, Action <Type, Type> injector, dynamic filter,
     dynamic blacklist = null, bool parallel = false, bool nested = true)
 {
     BatchDI.BatchInject(injector, filter, blacklist, parallel, nested);
     return(services);
 }
Пример #2
0
 public static IServiceCollection BatchScoped(
     this IServiceCollection services, string filter,
     dynamic blacklist = null, bool parallel = false, bool nested = true)
 {
     if (BatchDI.filterHasInterface(filter))
     {
         Action <Type, Type> caller = (_interface, _implementation) => services.AddScoped(_interface, _implementation);
         BatchDI.BatchInject(caller, filter, blacklist, parallel, nested);
     }
     else
     {
         Action <Type> caller = (_implementation) => services.AddScoped(_implementation);
         BatchDI.BatchInject(caller, filter, blacklist, parallel, nested);
     }
     return(services);
 }
Пример #3
0
 public static IWebHostBuilder SetBatchDIEntryPoint <T>(this IWebHostBuilder webhost)
 {
     BatchDI.SetEntryAssembly(Assembly.GetAssembly(typeof(T)));
     return(webhost);
 }