Beispiel #1
0
        public async Task <IActionResult> Put(Guid id, [FromBody] ProjetoFormViewModel model)
        {
            if (!await _projetoService.Existe(id))
            {
                return(RegistroNaoEncontrado(id));
            }

            var result = await _projetoService.Editar(id, _mapper.Map <Projeto>(model));

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

            return(BadRequest(result.Result));
        }