public ProductsPriceInsert InsertProductPrice(ProductsPriceInsert productsPriceInsert) { using (SqlConnection connection = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand("ProcedureInsertProductsPrice", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@ProductPrice", productsPriceInsert.ProductPrice); connection.Open(); command.ExecuteNonQuery(); } return(productsPriceInsert); } }
//[Consumes("application/json")] public IActionResult Post([FromBody] ProductsPriceInsert productsPriceInsert) { return(Ok(new ProductPricesDataLayer(_configuration).InsertProductPrice(productsPriceInsert))); }