public async Task <IActionResult> PutRegistro([FromRoute] int id, [FromBody] Registro registro) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != registro.Id) { return(BadRequest()); } await _context.Update(registro); try { await _context.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!_context.Exists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }