public async Task <IActionResult> Post(InputTerm value)
        {
            if (ModelState.IsValid)
            {
                var result = await _termsService.CreateAsync(value);

                return(Ok(result));
            }
            return(Ok(new { Success = false, Message = getErrorMessages() }));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Store([FromBody] TermViewModel model)
        {
            await ValidateRequestAsync(model);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var term = model.MapEntity(_mapper, CurrentUserId);

            term = await _termsService.CreateAsync(term);

            return(Ok(term.Id));
        }