public async Task <IActionResult> PutTodoItem(int id, PruebasTablas todoItem) { if (id != todoItem.Id) { return(BadRequest()); } _context.Entry(todoItem).State = EntityState.Modified; // Creo otro TodoListContext try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PruebasTablas> > PostTodoItem(PruebasTablas todoItem) { _context.PruebaTabla.Add(todoItem); await _context.SaveChangesAsync(); //return CreatedAtAction("GetTodoItem", new { id = todoItem.Id }, todoItem); return(CreatedAtAction(nameof(GetTodoItem), new { id = todoItem.Id }, todoItem)); }