示例#1
0
        public void InsertTest()
        {
            List <Meal> meals    = MealManager.Load();
            FoodItem    foodItem = new FoodItem();

            foodItem.Id       = Guid.NewGuid();
            foodItem.FDCId    = 5555555;
            foodItem.MealId   = meals.FirstOrDefault(m => m.Description == "Breakfast").Id;
            foodItem.Quantity = 999;

            int results = FoodItemManager.Insert(foodItem, true);

            Assert.IsTrue(results > 0);
        }
示例#2
0
 // POST api/values
 public int Post([FromBody] Food value)
 {
     return(FoodItemManager.Insert(value));
 }