Пример #1
0
        public async Task <ActionResult <ClothesOrders> > PostClothesOrders(ClothesOrders clothesOrders)
        {
            _context.ClothesOrders.Add(clothesOrders);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetClothesOrders", new { id = clothesOrders.Id }, clothesOrders));
        }
Пример #2
0
        public async Task <IActionResult> PutClothesOrders(int id, ClothesOrders clothesOrders)
        {
            if (id != clothesOrders.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }