Ejemplo n.º 1
0
 public void Combine(DeliveryOptionCollection options)
 {
     foreach (var option in options)
     {
         this.Add(option);
     }
 }
Ejemplo n.º 2
0
        private static IEnumerable <DeliveryOption> BuildDeliveryOptions(RateReply rateReply, IShipment shipment)
        {
            var optionCollection = new DeliveryOptionCollection();

            foreach (var rateReplyDetail in rateReply.RateReplyDetails)
            {
                var service = rateReplyDetail.ServiceType.ToString();

                optionCollection.AddRange(rateReplyDetail.RatedShipmentDetails.Select(shipmentDetail => shipmentDetail.ShipmentRateDetail.TotalNetCharge.Amount).Select(rate => new DeliveryOption {
                    Rate = rate, Service = service
                }));
            }

            return(optionCollection);
        }