public async Task <IActionResult> PutProductTypeMaterial(int id, ProductTypeMaterial productTypeMaterial) { if (id != productTypeMaterial.ProductTypeMaterialId) { return(BadRequest()); } _context.Entry(productTypeMaterial).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductTypeMaterialExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ProductTypeMaterial> > PostProductTypeMaterial(ProductTypeMaterial productTypeMaterial) { _context.productTypeMaterial.Add(productTypeMaterial); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProductTypeMaterial", new { id = productTypeMaterial.ProductTypeMaterialId }, productTypeMaterial)); }