Ejemplo n.º 1
0
        private List <Food> TypeBasedSearchFoods(string token, FoodType foodType, int userId, string searchName, int start, int size)
        {
            List <Food> foods = null;

            switch (foodType)
            {
            case FoodType.ADDED:
                foods = businessLogicLayer.SearchAddedFoods(token, userId, searchName, start, size);
                break;

            case FoodType.LIKE:
                foods = businessLogicLayer.SearchLikeFoods(token, userId, searchName, start, size);
                break;

            case FoodType.RECOMMENDED:
                foods = businessLogicLayer.SearchRecommendedFoods(token, userId, searchName, start, size);
                break;

            case FoodType.COMPOSED:
                throw new MissingMethodException("Please, use 'food/search/products' api");
            }
            return(foods);
        }