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()); }
public async Task <ActionResult <ProductTypeRefinement> > PostProductTypeRefinement(ProductTypeRefinement productTypeRefinement) { _context.productTypeRefinement.Add(productTypeRefinement); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProductTypeRefinement", new { id = productTypeRefinement.ProductTypeRefinementId }, productTypeRefinement)); }