public async Task <IActionResult> PutUsuario([FromBody] Usuario usuario) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Entry(usuario).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(usuario.Email)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDenunciaMovimentoTipo([FromRoute] int id, [FromBody] DenunciaMovimentoTipo denunciaMovimentoTipo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != denunciaMovimentoTipo.IdDenunciaMovimentoTipo) { return(BadRequest()); } _context.Entry(denunciaMovimentoTipo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DenunciaMovimentoTipoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }