public async Task <IActionResult> CreateProductCategory([FromBody] Production.ProductCategory value) { _db.Production_ProductCategory.Add(value); await _db.SaveChangesAsync(); return(Ok(value)); }
public async Task <IActionResult> EditProductCategory(int productCategoryID, [FromBody] Production.ProductCategory value) { var existing = await _db.Production_ProductCategory.FirstOrDefaultAsync(x => x.ProductCategoryID == productCategoryID); if (existing == null) { return(NotFound()); } existing.ProductCategoryID = value.ProductCategoryID; existing.Name = value.Name; existing.rowguid = value.rowguid; existing.ModifiedDate = value.ModifiedDate; _db.Production_ProductCategory.Update(existing); await _db.SaveChangesAsync(); return(NoContent()); }