public ActionResult Attending() { var userId = User.Identity.GetUserId(); var viewModel = new ConcertsViewModel() { UpcomingConcerts = _unitOfWork.Concerts.GetConcertsUserAttending(userId), ShowActions = User.Identity.IsAuthenticated, Heading = "Concersts I'm attending", Attendances = _unitOfWork.Attendances.GetFutureAttendances(userId).ToLookup(a => a.ConcertId) }; return(View("Concerts", viewModel)); }
public ActionResult Index(string query = null) { var upcomingConcerts = _unitOfWork.Concerts.GetUpcomingConcerts(query); var userId = User.Identity.GetUserId(); var attendances = _unitOfWork.Attendances.GetFutureAttendances(userId) .ToLookup(a => a.ConcertId); var viewModel = new ConcertsViewModel { UpcomingConcerts = upcomingConcerts, ShowActions = User.Identity.IsAuthenticated, Heading = "Upcoming Concerts", SearchTerm = query, Attendances = attendances }; return(View("Concerts", viewModel)); }
public ConcertsPage() { InitializeComponent(); BindingContext = new ConcertsViewModel(); }
public ActionResult Search(ConcertsViewModel viewModel) { return(RedirectToAction("Index", "Home", new { query = viewModel.SearchTerm })); }