Exemple #1
0
 public async Task ApplyRulesAfterSave(Tenant tenant, TenantModel input)
 {
     using (var scope = _iocResolver.CreateScope())
     {
         var assemblies      = _assembly.GetAssembliesByType(typeof(IRuleAfterSaveTenant));
         var allScopeResolve = assemblies.Select(x => (IRuleAfterSaveTenant)scope.Resolve(x));
         var allTask         = allScopeResolve
                               .Select(x => x.ApplyRules(tenant, input))
                               .ToList();
         await Task.WhenAll(allTask);
     }
 }