public async Task <ActionResult <ContagemCheque> > PostContagemCheque(ContagemCheque contagemCheque) { _context.ContagemCheque.Add(contagemCheque); await _context.SaveChangesAsync(); return(CreatedAtAction("GetContagemCheque", new { id = contagemCheque.ContagemChequeId }, contagemCheque)); }
public async Task <IActionResult> PutContagemCheque(int id, ContagemCheque contagemCheque) { if (id != contagemCheque.ContagemChequeId) { return(BadRequest()); } _context.Entry(contagemCheque).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContagemChequeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }