public async Task <ActionResult <Caixacontrole> > PostCaixacontrole([FromForm] Caixacontrole caixacontrole) { _context.Caixacontrole.Add(caixacontrole); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCaixacontrole", new { id = caixacontrole.Id }, caixacontrole)); }
public async Task <IActionResult> PutCaixacontrole(int id, [FromForm] Caixacontrole caixacontrole) { if (id != caixacontrole.Id) { return(BadRequest()); } _context.Entry(caixacontrole).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CaixacontroleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }