Пример #1
0
        public async Task <IActionResult> CreateRule([FromBody] RuleDetailedDTO dtos)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var rule = _mapper.Map <Rule>(dtos);

            rule.CreatedUserId = rule.UpdatedUserId = UserId;
            await _ruleService.Create(rule);

            return(Ok(rule));
        }