public IEnumerable <ShoppingCartItemViewModel> GetRange(int skip, int take) { IEnumerable <ShoppingCartItem> shoppingCartItems = _shoppingCartItemService.GetRange(skip, take); List <ShoppingCartItemViewModel> shoppingCartItemViewModels = new List <ShoppingCartItemViewModel>(); if (shoppingCartItems != null) { foreach (var shoppingCart in shoppingCartItems) { shoppingCartItemViewModels.Add(new ShoppingCartItemViewModel(shoppingCart)); } } return(shoppingCartItemViewModels); }
public IEnumerable <ShoppingCartItemViewModel> GetRange(int skip, int take) { return(Mapper.Map <IEnumerable <ShoppingCartItem>, IEnumerable <ShoppingCartItemViewModel> >(_shoppingCartItemService.GetRange(skip, take))); }