/// <summary>
 /// Function to Get Summary By UserId.
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public InvoiceSummary GetInvoiceSummary(string userId)
 {
     try
     {
         return(this.CalculateFare(rideRepository.GetRides(userId)));
     }
     catch (CabInvoiceException)
     {
         throw new CabInvoiceException(CabInvoiceException.ExceptionType.INVALID_USER_ID, "Invalid UserID");
     }
 }
 /// <summary>
 /// Gets the rides.
 /// </summary>
 /// <param name="userID">The user identifier.</param>
 /// <returns></returns>
 public Ride[] GetRides(string userID)
 {
     return(rideRepository.GetRides(userID));
 }
Exemple #3
0
        public void MapRidesToUser(string userID, Rides[] rides) => RideRepository.AddRides(userID, rides);            //create MapRidesToUser method

        public InvoiceSummary GetInvoiceSummary(string userID) => this.CalculateFare(RideRepository.GetRides(userID)); //create method GetInvoiceSummary