Пример #1
0
        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));
        }
Пример #2
0
 public ActionResult <List <Journey> > GetAll()
 {
     return(_journeyService.GetAll());
 }