public async Task <ActionResult <ProductItem> > PostProductItem(ProductItem item) { // Validation & calculation if (item.ValidateNewItem()) { item.CalculateMissingParameters(); _context.ProductItems.Add(item); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetProductItem), new ProductItem { Id = item.Id }, item)); } else { return(UnprocessableEntity()); } }