Exemplo n.º 1
0
        public ProductListModel Get()
        {
            var  currentUserID = _usermanager.GetUserId(User);
            Guid id            = new Guid(currentUserID);
            var  productList   = ProductListModel.Get(_productRepository, _productCategoryRepository, _productImageRepository, id);

            return(productList);
        }
Exemplo n.º 2
0
        public IPaginate <ProductListModel.ListItem> Get(int index, int size, int from)
        {
            var  currentUserID = _usermanager.GetUserId(User);
            Guid id            = new Guid(currentUserID);
            var  productList   = ProductListModel.Get(_productRepository, _productCategoryRepository, _productImageRepository, id);
            var  page          = IPaginateExtension.ToPaginate <ProductListModel.ListItem>(productList.Products.ToList(), index, size, from);

            return(page);
        }
Exemplo n.º 3
0
        public ProductListModel Get()
        {
            var productList = ProductListModel.Get(_ProductRepository);

            //var products = _ProductRepository.GetAll().Result;
            //List<ProductViewModel> productViewModel = new List<ProductViewModel>();
            //foreach(var item in products)
            //{
            //    var proview = new ProductViewModel
            //    {
            //        ID = item.ID,
            //        Name = item.Name,
            //        categoryID = item.categoryID,
            //        categoryNames = { },//item.ProductInCategories.Select(x => x.ProductCategory.Name).ToList(),
            //        Price = item.Price,
            //        PromotionPrice = item.PromotionPrice,
            //        Status = item.Status
            //    };
            //    productViewModel.Add(proview);
            //}
            return(productList);
        }
Exemplo n.º 4
0
        public ProductListModel Get()
        {
            var productList = ProductListModel.Get(_productRepository, _productCategoryRepository);

            return(productList);
        }