private void Initialize(IEnumerable <ShippingMethod> shippingMethods) { if (shippingMethods == null) { return; } var shippingMethodList = new List <ShippingMethodApiModel>(); foreach (var shippingMethod in shippingMethods) { var jsonResult = new ShippingMethodApiModel(); jsonResult.Initialize(shippingMethod); shippingMethodList.Add(jsonResult); } ShippingMethods = shippingMethodList; }
public void Initialize(ShippingMethodPerItem shippingMethodPerItem) { if (shippingMethodPerItem == null) { return; } LineId = shippingMethodPerItem.LineId; if (shippingMethodPerItem.ShippingMethods != null && shippingMethodPerItem.ShippingMethods.Any()) { var shippingMethodList = new List <ShippingMethodApiModel>(); foreach (var shippingMethod in shippingMethodPerItem.ShippingMethods) { var jsonResult = new ShippingMethodApiModel(); jsonResult.Initialize(shippingMethod); shippingMethodList.Add(jsonResult); } ShippingMethods = shippingMethodList; } }