Exemple #1
0
        public async Task <ICollection <Product> > SelectProductsAsync(string partOfName = null)
        {
            ICollection <Product> products = partOfName == null ?
                                             await productRepository.SelectAllAsync() :
                                             await productRepository.SelectByNameAsync(partOfName);

            return(products);
            //return products.Where(p => p.IsDiscontinued == false).ToList();
        }
        public async Task <IActionResult> GetAllAsync()
        {
            var products = await productRepository.SelectAllAsync();

            return(Ok(products));
        }