public void QueryProducts() { var result = _items.AsQueryable().Where(ProductQueries.GetAll()).OrderBy(ProductQueries.WhereOrderBy()); Assert.AreEqual(2, result.Count()); }
public IEnumerable <Product> GetAll() { return(_context.Product .Where(ProductQueries.GetAll()) .OrderBy(ProductQueries.WhereOrderBy())); }
public async Task <IActionResult> Get([FromServices] ProductQueries productQueries) { return(Ok(await productQueries.GetAll())); }