public ActionResult View(int id, bool?admin) { if (admin.GetValueOrDefault()) { ViewBag.IsAdmin = true; } var user = _userDataAccess.GetUserById(id); var events = _eventDataAccess.GetEventsForUser(user.Id); var model = new UserDetailsModel { User = user, Events = events, }; return(View(model)); }