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)); }
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); }