Beispiel #1
0
        public List <ShowFoodDto> ListFoods()
        {
            var adapter = new ListFoodAdapter();
            var list    = _restaurantManager.ListFood();

            return(adapter.Transform(list));
        }
Beispiel #2
0
        public List <ShowFoodDto> ListFoodsNotInMenu(long menuId)
        {
            var menu = _restaurantManager.GetMenuWithMappings(menuId);

            if (menu != null)
            {
                var menuFoodMappings = menu.FoodMappings;
                var mappedFoods      = _restaurantManager.ListNonMenuFoods(menuFoodMappings);
                var adapter          = new ListFoodAdapter();
                return(adapter.Transform(mappedFoods));
            }
            else
            {
                throw new Exception("Given menu is not found");
            }
        }