public async Task <ActionResult <IEnumerable <GameReadDto> > > GetUserGames() { var user = await _userManager.FindByEmailAsync(HttpContext.User.Identity.Name); var games = _repository.GetAllGames().Where(g => g.IdentityId == user.Id); return(Ok(_mapper.Map <IEnumerable <GameReadDto> >(games))); }
public IActionResult Index(bool search) { homeViewModel.Games = CreateGameCards(gamesTable.GetAllGames()); if (User.Identity.IsAuthenticated) { User user = usersTable.GetUserByEmail(User.Identity.Name !) !; ViewBag.User = user; ViewData["layout"] = "~/Views/Shared/_AuthorizedLayout.cshtml"; } ViewBag.isRedirectedFromOtherPageBySearchBtn = search; return(View(homeViewModel)); }
public List <Game> GetAllGames() { List <Game> game = repo.GetAllGames(); return(game); }
public IActionResult Index() { var games = gameRepo.GetAllGames(); return(View(games)); }