//UPDATE SINGLE ITEM public void UpdateGroceryItem(Item_UpdateRequest model) { using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["GroceryListConnection"].ConnectionString)) { con.Open(); var cmd = con.CreateCommand(); cmd.CommandText = "UpdateGroceryItem"; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", model.Id); cmd.Parameters.AddWithValue("@Items", model.Items); //What happens if I leave off @? cmd.Parameters.AddWithValue("@Quantity", model.Quantity); cmd.ExecuteNonQuery(); } }
public void UpdateGroceryItem(Item_UpdateRequest model) { groceryListService.UpdateGroceryItem(model); }