Пример #1
0
        public async Task <IActionResult> PutProductTypeRefinement(int id, ProductTypeRefinement productTypeRefinement)
        {
            if (id != productTypeRefinement.ProductTypeRefinementId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Пример #2
0
        public async Task <ActionResult <ProductTypeRefinement> > PostProductTypeRefinement(ProductTypeRefinement productTypeRefinement)
        {
            _context.productTypeRefinement.Add(productTypeRefinement);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProductTypeRefinement", new { id = productTypeRefinement.ProductTypeRefinementId }, productTypeRefinement));
        }