예제 #1
0
        public async Task <IActionResult> PutCatogory(int id, Catogory catogory)
        {
            if (id != catogory.CatogoryId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PutProductOrders(int id, ProductOrders productOrders)
        {
            if (id != productOrders.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }