Beispiel #1
0
        public async Task <ActionResult <EntidadeViewModel> > Post(EntidadeViewModel entidadeViewModel)
        {
            var objeto = _mapper.Map <Projeto>(entidadeViewModel);

            var retorno = _mapper.Map <EntidadeViewModel>(await _entidadeService.Adicionar(objeto));

            return(retorno);
        }
Beispiel #2
0
        public async Task <ActionResult <EntidadeViewModel> > Adicionar([FromBody] EntidadeViewModel entidadeViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(CustomResponse(ModelState));
            }
            await _entidadeService.Adicionar(_mapper.Map <Entidade>(entidadeViewModel));

            return(CustomResponse(entidadeViewModel));
        }