public ProductPurchase ConfirmPurchaseWith(Guid reservationId) { if (!ReservationIdValid(reservationId)) { throw new Exception(string.Format("Cannot confirm the purchase with this Id: {0}", reservationId)); } ProductReservation reservation = GetReservationWith(reservationId); ProductPurchase purchase = new ProductPurchase(this, reservation.Quantity); reservation.HasBeenConfirmed = true; PurchasedProducts.Add(purchase); return purchase; }
public ProductPurchase ConfirmPurchaseWith(Guid reservationId) { if (!ReservationIdValid(reservationId)) { throw new Exception(string.Format("Cannot confirm the purchase with this Id: {0}", reservationId)); } ProductReservation reservation = GetReservationWith(reservationId); ProductPurchase purchase = new ProductPurchase(this, reservation.Quantity); reservation.HasBeenConfirmed = true; PurchasedProducts.Add(purchase); return(purchase); }