コード例 #1
0
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            if (MyTeamQuery.Any() == false)
            {
                throw new UnauthorizedAccessException("User has no access to a team");
            }

            base.OnActionExecuting(context);
        }
コード例 #2
0
        public IActionResult Index()
        {
            var faq = DbContext
                      .CommonQuestion
                      .Where(e => e.Contest.Year == MyTeamQuery.Select(t => t.Contest.Year).Single())
                      .ToList();

            FillViewBag();
            return(View(faq));
        }