Exemplo n.º 1
0
        public IActionResult AddGame()
        {
            User user = usersTable.GetUserByEmail(User.Identity.Name !) !;

            ViewBag.User       = user;
            ViewData["layout"] = "~/Views/Shared/_AuthorizedLayout.cshtml";

            if (!user.IsAdmin)
            {
                return(RedirectToAction("AccessDenied", "ErrorPage"));
            }

            viewModel = new GameManagementViewModel {
                Genres   = genresTable.GetAllGenres(),
                Features = featuresTable.GetAllFeatures()
            };

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public HomeController(IGameRepo gameR, IFeatureRepo featureR, IGenreRepo genreR, IPriceCategoryRepo categoryR, IUserRepo userR)
        {
            gamesTable           = gameR;
            featuresTable        = featureR;
            genresTable          = genreR;
            priceCategoriesTable = categoryR;
            usersTable           = userR;

            homeViewModel = new HomeViewModel {
                FeaturesFilters = featuresTable.GetAllFeatures(),
                GenresFilters   = genresTable.GetAllGenres(),
                PriceFilters    = priceCategoriesTable.GetAllCategories()
            };
        }
 public Task <IEnumerable <Feature> > GetAllFeatures()
 {
     return(_featureRepo.GetAllFeatures());
 }
Exemplo n.º 4
0
 public List <Feature> GetAllFeatures()
 {
     return(_repo.GetAllFeatures());
 }