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); }
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)); }