public async Task <ActionResult <PayCheque> > PostPayCheque(PayCheque payCheque) { _context.payCheques.Add(payCheque); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPayCheque", new { id = payCheque.Id }, payCheque)); }
public async Task <IActionResult> PutPayCheque(int id, PayCheque payCheque) { if (id != payCheque.Id) { return(BadRequest()); } _context.Entry(payCheque).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayChequeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }