Esempio n. 1
0
        public async Task <IActionResult> UpdateAsync([FromBody] AcaoDto model)
        {
            var validationResult = await _service.UpdateAsync(model);

            if (validationResult.Any())
            {
                return(BadRequest(validationResult));
            }
            else
            {
                return(NoContent());
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> CreateAsync([FromBody] AcaoDto model)
        {
            var validationResult = await _service.CreateAsync(model);

            if (validationResult.Any())
            {
                return(BadRequest(validationResult));
            }
            else
            {
                return(Created("", model));
            }
        }
Esempio n. 3
0
 public async Task <IEnumerable <ValidationResult> > UpdateAsync(AcaoDto dto)
 {
     return(await _repository.UpdateAsync(_mapper.Map <Acao>(dto)));
 }
Esempio n. 4
0
 public async Task DeleteAsync(AcaoDto dto)
 {
     await _repository.DeleteAsync(_mapper.Map <Acao>(dto));
 }