public async Task <ActionResult <CashMovType> > PostCashMovType(CashMovType cashMovType) { _context.CashMovTypes.Add(cashMovType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCashMovType", new { id = cashMovType.ID }, cashMovType)); }
public async Task <IActionResult> PutCashMovType(int id, CashMovType cashMovType) { if (id != cashMovType.ID) { return(BadRequest()); } _context.Entry(cashMovType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CashMovTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }