Exemplo n.º 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);
 }
Exemplo n.º 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);
 }