Ejemplo n.º 1
0
 private void SeedMeal(IBusinessService businessService)
 {
     var currentDate = businessService.GetMostRecentDay();
     var meal = new MealModel
     {
         Date = currentDate.Date,
         MealNumber = 1,
         MealEntries = new List<MealEntry> {
             new MealEntry
             {
                 MealEntryNumber = 0,
                 Calories = 120,
                 Food= businessService.GetFoodByName("chicken")
             },
             new MealEntry
             {
                 MealEntryNumber = 1,
                 Calories = 184,
                 Food= businessService.GetFoodByName("eggs")
             }}
     };
     businessService.AddMeal(meal);
     meal.MealNumber = 2;
     meal.MealEntries.FirstOrDefault().Id = 0;
     meal.MealEntries.LastOrDefault().Id = 0;
     businessService.AddMeal(meal);
 }