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

            return(productList);
        }
        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);
        }
        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);
        }
Exemple #4
0
        public ProductListModel Get()
        {
            var productList = ProductListModel.Get(_productRepository, _productCategoryRepository);

            return(productList);
        }