public async Task <ActionResult <FilesPayCheque> > PostFilesPayCheque(FilesPayCheque filesPayCheque) { _context.filesPays.Add(filesPayCheque); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFilesPayCheque", new { id = filesPayCheque.Id }, filesPayCheque)); }
public async Task <IActionResult> PutFilesPayCheque(int id, FilesPayCheque filesPayCheque) { if (id != filesPayCheque.Id) { return(BadRequest()); } _context.Entry(filesPayCheque).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FilesPayChequeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }