コード例 #1
0
        public async Task <ActionResult <FilesPayCheque> > PostFilesPayCheque(FilesPayCheque filesPayCheque)
        {
            _context.filesPays.Add(filesPayCheque);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFilesPayCheque", new { id = filesPayCheque.Id }, filesPayCheque));
        }
コード例 #2
0
        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());
        }