예제 #1
0
        public async Task <IActionResult> DisplayAds()
        {
            var ads = await driverSer.GetAllAdsAsync();

            var notBookedAds = ads.Where(x => x.DriverId == null).ToArray();
            var loggedInUser = await userMan.GetUserAsync(HttpContext.User);

            var        driverId = driverSer.GetDriverId(loggedInUser.Id);
            AdSearchVm vm       = new AdSearchVm
            {
                DriverId = driverId,
                Ads      = notBookedAds
            };

            return(View(vm));
        }