예제 #1
0
        public async Task <ActionResult <FCT_Purchase> > PostFCT_Purchase(FCT_Purchase fCT_Purchase)
        {
            _context.FCT_Purchase.Add(fCT_Purchase);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFCT_Purchase", new { id = fCT_Purchase.id }, fCT_Purchase));
        }
예제 #2
0
        public async Task <IActionResult> PutFCT_Purchase(int id, FCT_Purchase fCT_Purchase)
        {
            if (id != fCT_Purchase.id)
            {
                return(BadRequest());
            }

            _context.Entry(fCT_Purchase).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FCT_PurchaseExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }