public ShipmentItem(model.ShipmentItem item = null)
        {
            if (item != null)
            {
                this.InjectFrom(item);

                var propInfo = item.GetType().FindPropertiesWithAttribute(typeof(KeyAttribute)).First();
                ShipmentItemId  = propInfo.GetValue(item) as string ?? Guid.NewGuid().ToString();
                ItemCode        = item.LineItem != null ? item.LineItem.CatalogItemCode : null;
                ItemName        = item.LineItem != null ? item.LineItem.DisplayName : null;
                UnitPrice       = item.LineItem != null ? item.LineItem.PlacedPrice : 0;
                ShippingAddress = item.Shipment != null && item.Shipment.OrderForm != null?item.Shipment.OrderForm.OrderGroup.OrderAddresses.Where(address => address.Name == "Shipping").FirstOrDefault().ToString() : string.Empty;

                BillingAddress = item.Shipment != null && item.Shipment.OrderForm != null?item.Shipment.OrderForm.OrderGroup.OrderAddresses.Where(address => address.Name == "Billing").FirstOrDefault().ToString() : string.Empty;

                Customer         = item.Shipment != null && item.Shipment.OrderForm != null ? item.Shipment.OrderForm.OrderGroup.CustomerName : string.Empty;
                Order            = item.Shipment != null && item.Shipment.OrderForm != null ? ((Order)item.Shipment.OrderForm.OrderGroup).TrackingNumber : string.Empty;
                OrderDate        = item.Shipment != null && item.Shipment.OrderForm != null ? item.Shipment.OrderForm.OrderGroup.Created : null;
                ShippingTaxTotal = item.Shipment != null ? item.Shipment.ShippingTaxTotal : 0;
                ItemTaxTotal     = item.Shipment != null ? item.Shipment.ItemTaxTotal : 0;
                ItemSubtotal     = item.Shipment != null ? item.Shipment.ItemSubtotal : 0;
                Subtotal         = item.Shipment != null ? item.Shipment.Subtotal : 0;
                TotalBeforeTax   = item.Shipment != null ? item.Shipment.TotalBeforeTax : 0;
                BillingCurrency  = item.Shipment != null && item.Shipment.OrderForm != null ? item.Shipment.OrderForm.OrderGroup.BillingCurrency : string.Empty;
                ShippingTotal    = item.Shipment != null ? item.Shipment.ShipmentTotal : 0;
                DiscountAmount   = item.Shipment != null ? item.Shipment.ShippingDiscountAmount : 0;
            }
        }