public ProductsVariableCostInsert InsertProductVariableCost(ProductsVariableCostInsert productsVariableCostInsert) { using (SqlConnection connection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("ProcedureInsertProductsVariableCost", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@ProductVariableCost", productsVariableCostInsert.ProductsVariableCost); connection.Open(); command.ExecuteNonQuery(); } return(productsVariableCostInsert); } }
//[Consumes("application/json")] public IActionResult Post([FromBody] ProductsVariableCostInsert productsVariableCostInsert) { return(Ok(new ProductVariableCostsDataLayer(_configuration).InsertProductVariableCost(productsVariableCostInsert))); }