Exemple #1
0
        public async Task <IEnumerable <Product> > GetProductBySearchTermsAsync(Product product)
        {
            IEnumerable <Product> products = _context.Set <Product>()
                                             .OrderByDescending(c => c.ProductId)
                                             .AsQueryable();

            var searchResponse = await _searchFilterHealpers.SearchByContains(products, product);

            var response = Mapper.Map <IEnumerable <Product> >(searchResponse);

            return(response);
        }
Exemple #2
0
        public async Task <IEnumerable <Customer> > GetCustomerBySearchTermsAsync(Customer customer)
        {
            IEnumerable <Customer> customers = _context.Set <Customer>()
                                               .Include(c => c.Addres)
                                               .AsQueryable()
                                               .OrderByDescending(c => c.CustomerId);

            var searchResponse = await _searchFilterHealpers.SearchByContains(customers, customer);

            var response = Mapper.Map <IEnumerable <Customer> >(searchResponse);

            return(response);
        }