Exemplo n.º 1
0
        public ActionResult Index()
        {
            var viewModel = HomeViewModel.Create(RepositoryFactory.SiteRepository, SiteService.LoadSite(Site));

            viewModel.Files = RepositoryFactory.FileRepository.Queryable.Where(a => a.Home);
            return(View(viewModel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Home()
        {
            var user = await GetViewUserAsync();

            var viewModel = await HomeViewModel.Create(user, dbContext);

            return(View(viewModel));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Home(int gameID)
        {
            var user = await GetViewUserAsync();

            var game = await dbContext.Games.Include(g => g.Characters).AsNoTracking().Include(g => g.Stages).AsNoTracking().FirstOrDefaultAsync(g => g.ID == gameID);

            if (game == null)
            {
                return(NotFound());
            }

            var viewModel = HomeViewModel.Create(user, game, cdnService);

            return(View(viewModel));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Home(int seasonID)
        {
            var user = await GetViewUserAsync();

            var season = await dbContext.Seasons
                         .Include(s => s.Sets).ThenInclude(s => s.League).AsNoTracking()
                         .Include(s => s.Sets).ThenInclude(s => s.Player1).ThenInclude(lu => lu.User).AsNoTracking()
                         .Include(s => s.Sets).ThenInclude(s => s.Player2).ThenInclude(lu => lu.User).AsNoTracking()
                         .Include(s => s.Participants).ThenInclude(slu => slu.LeagueUser).ThenInclude(lu => lu.User).AsNoTracking()
                         .Include(s => s.League).AsNoTracking()
                         .FirstOrDefaultAsync(s => s.ID == seasonID);

            if (season == null)
            {
                return(CodeResultAndLog(HttpStatusCode.NotFound, $"No season with ID {seasonID} found."));
            }

            var viewModel = HomeViewModel.Create(user, season);

            return(View(viewModel));
        }
Exemplo n.º 5
0
        public async Task <ActionResult> Home(string tabId, int parentId)
        {
            var model = HomeViewModel.Create(tabId, parentId, DbService.Home());

            return(await JsonHtml("Home", model));
        }
Exemplo n.º 6
0
        public ActionResult Home(string tabId, int parentId)
        {
            var model = HomeViewModel.Create(tabId, parentId, DbService.Home());

            return(JsonHtml("Home", model));
        }
Exemplo n.º 7
0
        public ActionResult Index()
        {
            HomeViewModel viewModel = HomeViewModel.Create(_tNewsRepository, _tLoanRepository);

            return(View(viewModel));
        }