public IActionResult Index() { string currentUsername = User.Identity.Name; IList <Journey> journeys = journeyService.GetAll(j => j.Driver.UserName == currentUsername || j.Passengers.Any(p => p.User.UserName == currentUsername)) .OrderByDescending(j => j.SetOffTime) .ToList(); IList <JourneyChatViewModel> mappedJourneys = mapper.Map <IList <Journey>, IList <JourneyChatViewModel> >(journeys); return(View(mappedJourneys)); }
public ActionResult <List <Journey> > GetAll() { return(_journeyService.GetAll()); }