How can I form a complex query() with this repository

Apr 11, 2014 at 2:03 PM
I have checked your samples but it seems you only have simple examples that query for just one thing at once:
// Simple query for all categories
var categories1 = categoryRepository
    .Query(c => c.CategoryID == 1)
How could I create a query to check for more than one property of the Category such as

c.CategoryID == 1 or c.CategoryID == 2
c.CategoryID == 1 or c.Description // starts with "Soft drinks"

A few examples with some more complex types of queries that demonstrate the methods available in the public interface IQueryObject<TEntity> would be much appreciated.
Apr 11, 2014 at 4:25 PM
Edited Apr 11, 2014 at 4:26 PM

Did you mean something like this:
var categories1 = categoryRepository
    .Query(c => c.CategoryID == 1)

// Another example

var categories1 = categoryRepository
    .Query(c => c.CategoryID == 1 || c.CategoryID == 2)
Any kind of compound boolean expression can be passed as a query argument.
Marked as answer by lelong37 on 4/16/2014 at 10:51 AM
Apr 12, 2014 at 5:50 AM

Your answer helped me a lot. Thanks for your quick reply.