public async Task <IHttpActionResult> GetFullInventory()
        {
            try
            {
                var cheese = await _inventoryService.GetCheeses();

                var bread = await _inventoryService.GetBreads();

                var sauce = await _inventoryService.GetSauces();

                var topping = await _inventoryService.GetToppings();

                var size = await _inventoryService.GetSizes();

                var lookup = new FullInventoryVm
                {
                    Cheeses  = cheese.ToList(),
                    Breads   = bread.ToList(),
                    Sauces   = sauce.ToList(),
                    Toppings = topping.ToList(),
                    Sizes    = size.ToList()
                };

                return(Ok(lookup));
            }
            catch (Exception)
            {
                // TODO: Add Raygun
                return(InternalServerError());
            }
        }
Exemple #2
0
        public async Task <IHttpActionResult> GetFullInventory()
        {
            var cheese = await _inventoryService.GetCheeses();

            var bread = await _inventoryService.GetBreads();

            var sauce = await _inventoryService.GetSauces();

            var topping = await _inventoryService.GetToppings();

            var size = await _inventoryService.GetSizes();

            var lookup = new FullInventoryVm
            {
                Cheeses  = cheese.ToList(),
                Breads   = bread.ToList(),
                Sauces   = sauce.ToList(),
                Toppings = topping.ToList(),
                Sizes    = size.ToList()
            };

            return(Ok(lookup));
        }