public IActionResult Put(Guid id, [FromBody] ApontamentoViewModel obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != obj.Id) { return(BadRequest()); } try { _apontamentoAppService.Alterar(obj); } catch (DbUpdateConcurrencyException) { if (!ObjExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public override async Task <BaseReply> Alterar(ApontamentoModel request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Sucesso = _apontamentoAppService.Alterar(_mapper.Map <ApontamentoViewModel>(request)) })); }