Пример #1
0
        //public async Task<IActionResult> AddOrUpdateRule([FromBody]IEnumerable<Rule> rules,
        //    [FromBody]IEnumerable<RuleCondition> ruleConditions, [FromBody]RuleGroup ruleGroup)
        public async Task <IActionResult> AddOrUpdateRule([FromBody] RuleResult result)
        {
            var taskResult = await _ruleService.AddOrUpdateRuleAsync(result.Rules, result.RuleConditions, result.RuleGroup);

            if (!taskResult)
            {
                ModelState.AddModelError("field", ErrorMessages.WebAdmin_Rule_E001);
                return(BadRequest(ModelState));
            }
            return(Ok());
        }