public async Task <ActionResult <Caixalancamento> > PostCaixalancamento(Caixalancamento caixalancamento) { _context.Caixalancamento.Add(caixalancamento); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCaixalancamento", new { id = caixalancamento.Id }, caixalancamento)); }
public async Task <IActionResult> PutCaixalancamento(int id, Caixalancamento caixalancamento) { if (id != caixalancamento.Id) { return(BadRequest()); } _context.Entry(caixalancamento).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CaixalancamentoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }