public ProductsVariableCostUpdate UpdateProductVariableCost(ProductsVariableCostUpdate productsVariableCostUpdate) { using (SqlConnection connection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("ProcedureUpdateProductsVariableCost", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@VariableCostIDUpdate", productsVariableCostUpdate.ProductsVariableCostID); command.Parameters.AddWithValue("@VariableCostValueUpdate", productsVariableCostUpdate.ProductsVariableCost); connection.Open(); command.ExecuteNonQuery(); } return(productsVariableCostUpdate); } }
public IActionResult Put([FromBody] ProductsVariableCostUpdate productsVariableCostUpdate) { return(Ok(new ProductVariableCostsDataLayer(_configuration).UpdateProductVariableCost(productsVariableCostUpdate))); }