public string ViewPendingRequestForRide(User user, int offerId, ref List <int> riderIds) { try { Ride ride = Dbr.GetRideById(offerId); if (!ride.CreatorId.Equals(user.Id)) { return("Offer is not belong to you..."); } StringBuilder bookingInfo = new StringBuilder(""); bookingInfo.Append(string.Format("{0,-10}{1,-11}{2,-16}{3,-9}{4,-10}", "Index", "Source", "Destination", "seats", "Rider Id")); int i = 1; //ride.Riders.Where(r => r.IsBookingConfirm == false).ToList() foreach (Rider rider in Dbrr.GetRidersByRideId(ride.Id).Where(r => r.IsBookingConfirm == false)) { bookingInfo.Append(string.Format("\n{0,-10}{1,-11}{2,-16}{3,-9}{4,-10}", i++, rider.Source, rider.Destination, rider.Seats, ride.Id)); riderIds.Add(rider.Id); } return(i == 1 ? "No Booking is Here for your Ride..." : bookingInfo.ToString()); } catch (Exception) { return("Ride is not Available..."); } }