Exemplo n.º 1
0
        public ICollection <Model.ShippingMethod> GetAllShippingMethods()
        {
            var shippingMethods = _shippingRepository.GetAllShippingMethods().Select(x => x.EntityToModel()).ToArray();

            foreach (var sm in shippingMethods)
            {
                sm.MethodRates = _shippingRepository.GetShippingRatesForMethod(sm.Id).Select(x => { var m = x.EntityToMedel(); m.ShippingMethod = sm; return(m); }).ToArray();
            }
            return(shippingMethods);
        }