Example #1
0
        public IActionResult <AllGamesVm> Index(HttpResponse response, HttpSession session)
        {
            if (!manager.IsAuthenticated(session))
            {
                Redirect(response, "/forum/login");
                return(null);
            }

            AllGamesVm model = this.service.HomePage();

            return(this.View(model));
        }
Example #2
0
        public AllGamesVm HomePage()
        {
            AllGamesVm model = new AllGamesVm();
            //  AllGamesViewModel all = new AllGamesViewModel();

            IEnumerable <AllGamesViewModel> allGamesView = this.data.Games.GetAll().Select(x => new AllGamesViewModel()
            {
                Description = x.Description,
                ImageUrl    = x.ImageUrl,
                Price       = x.Price,
                Size        = x.Size,
                Title       = x.Title,
            });


            model.AllGamesViewModel = allGamesView;


            return(model);
        }