Exemplo n.º 1
0
        private void DisplayAnimalsAndTheirFoodConsumptionPerWeek()
        {
            Console.Clear();
            UserInterface.ExplainFoodConsumptionList();
            var animals = db.GetTable <Animal>();
            var health  = db.GetTable <Health>();

            var query = animals.Join <Animal, Health, int?, dynamic>(health,
                                                                     a => a.animalId,
                                                                     h => h.animalId,
                                                                     (a, h) => new { a.name, h.foodConsumptionPerWeek });

            foreach (var group in query.ToList())
            {
                Console.WriteLine($">>{group.name}: consumes about {group.foodConsumptionPerWeek} cups of food a week");
            }
            UserInterface.PressAnyKeyToContinue();
            DecideWhatToDoAsAnEmployee();
        }