Beispiel #1
0
        public async Task <IActionResult> Post([FromBody] ProjetoFormViewModel model)
        {
            var result = await _projetoService.Cadastrar(_mapper.Map <Projeto>(model));

            if (result.IsValid)
            {
                return(Ok(_mapper.Map <ProjetoViewModel>(result.Entity)));
            }

            return(BadRequest(result.Result));
        }