Example #1
0
        public IEnumerable <ProductResponse> GetAllProducts()
        {
            var product = _context.Product
                          .Include(x => x.Holding)
                          .Include(x => x.Company)
                          .Include(x => x.Contact)
                          .Include(x => x.FotoUpload)
                          .Include(x => x.Interaction)
                          .Include(x => x.Category)
                          .ToList();

            return(ProductMapping.ListResponseMapping(product, null).OrderByDescending(x => x.Id));
        }
Example #2
0
        public IEnumerable <ProductResponse> GetAllWithLikedIndicator(int?id)
        {
            var product = _context.Product
                          .Include(x => x.Holding)
                          .Include(x => x.Company)
                          .Include(x => x.Contact)
                          .Include(x => x.FotoUpload)
                          .Include(x => x.Interaction)
                          .Include(x => x.Category)
                          .Where(x => x.IsActive)
                          .ToList();

            return(ProductMapping.ListResponseMapping(product, id).OrderByDescending(x => x.Id));
        }
Example #3
0
        public IEnumerable <ProductResponse> GetAllByUser(int?id)
        {
            if (id == null)
            {
                return(GetAllActive());
            }
            var product = _context.Product
                          .Include(x => x.Holding)
                          .Include(x => x.Company)
                          .Include(x => x.Contact)
                          .Include(x => x.FotoUpload)
                          .Include(x => x.Interaction)
                          .Include(x => x.Category)
                          .Where(x => x.PosterId == id)
                          .ToList();

            return(ProductMapping.ListResponseMapping(product, id).OrderByDescending(x => x.Id));
        }