/// <summary> /// Used to execute async rules. /// </summary> /// <returns></returns> public async Task <IRuleResult[]> ExecuteAsync() { if (!_rules.Any()) { return(await _asyncRuleService.GetAsyncRuleResultsAsync()); } var rules = await new BootstrapService <T>(_model, _ruleEngineId, _dependencyResolver) .BootstrapAsync(_rules); _asyncRuleService = new AsyncRuleService <T>(_model, rules, _ruleEngineConfiguration); await _asyncRuleService.InvokeAsyncRules(); return(await _asyncRuleService.GetAsyncRuleResultsAsync()); }
/// <summary> /// Used to execute async rules. /// </summary> /// <returns></returns> public async Task <IRuleResult[]> ExecuteAsync() { var rules = GetRules(); if (!rules.Any()) { return(_asyncRuleService.AsyncRuleResults.ToArray()); } await new RuleInitializationService <T>(_model, _ruleEngineId, _dependencyResolver).InitializeAsync(rules); _asyncRuleService = new AsyncRuleService <T>(_model, rules, _ruleEngineConfiguration); await _asyncRuleService.InvokeAsyncRules(rules); return(await _asyncRuleService.GetAsyncRuleResults()); }