Ejemplo n.º 1
0
        public void QueryProducts()
        {
            var result = _items.AsQueryable().Where(ProductQueries.GetAll()).OrderBy(ProductQueries.WhereOrderBy());

            Assert.AreEqual(2, result.Count());
        }
Ejemplo n.º 2
0
 public IEnumerable <Product> GetAll()
 {
     return(_context.Product
            .Where(ProductQueries.GetAll())
            .OrderBy(ProductQueries.WhereOrderBy()));
 }
Ejemplo n.º 3
0
 public async Task <IActionResult> Get([FromServices] ProductQueries productQueries)
 {
     return(Ok(await productQueries.GetAll()));
 }