Beispiel #1
0
        public void OnGet()
        {
            CurrentMenu = HttpContext.Session.GetObjectFromJson <List <int> >("CurrentMenu");
            if (CurrentMenu == null)
            {
                // CurrentMenu = new List<int>();
                CurrentMenu = new List <int>()
                {
                    3, 4
                };
            }

            Recipes = recipeData.GetRecipesByIds(CurrentMenu);
        }
Beispiel #2
0
        public void OnGet(string searchTerm)
        {
            CurrentUserId = userManager.GetUserId(User);
            Message       = config["Message"];
            Recipes       = recipeData.GetRecipesByName(searchTerm);

            CurrentMenu = HttpContext.Session.GetObjectFromJson <List <int> >("CurrentMenu");
            if (CurrentMenu == null)
            {
                CurrentMenu = new List <int>();
            }
            CurrentMenu.Count();

            //Listing Last five Recipes Seen
            var ViewedRecipesIds = HttpContext.Session.GetObjectFromJson <List <int> >("ViewedRecipesKey");

            if (ViewedRecipesIds == null)
            {
                ViewedRecipesIds = new List <int>();
            }

            ViewedRecipes = recipeData.GetRecipesByIds(ViewedRecipesIds.TakeLast(5));
        }