public async Task <DoteVM> Criar(DoteVM model) { var entity = _mapper.Map <Dote>(model); var ValidationResult = new CreateDoteCommandValidation().Validate(entity); if (!ValidationResult.IsValid) { await NotificarValidacoesErro(ValidationResult); return(model); } _doteRepository.Add(entity); await _doteRepository.SaveChangesAsync(); return(_mapper.Map <DoteVM>(entity)); }
public async Task <IActionResult> Put([FromBody] DoteVM model) { return(Response(await _doteAppService.Atualizar(model))); }