public async Task <IActionResult> UpdateAsync([FromBody] AcaoDto model) { var validationResult = await _service.UpdateAsync(model); if (validationResult.Any()) { return(BadRequest(validationResult)); } else { return(NoContent()); } }
public async Task <IActionResult> CreateAsync([FromBody] AcaoDto model) { var validationResult = await _service.CreateAsync(model); if (validationResult.Any()) { return(BadRequest(validationResult)); } else { return(Created("", model)); } }
public async Task <IEnumerable <ValidationResult> > UpdateAsync(AcaoDto dto) { return(await _repository.UpdateAsync(_mapper.Map <Acao>(dto))); }
public async Task DeleteAsync(AcaoDto dto) { await _repository.DeleteAsync(_mapper.Map <Acao>(dto)); }