Reputation: 1
I want to apply filters on my query something like this
filters.Aggregate(query, (current, filter) => current.Where(filter));
But this creates query with AND as binder for example, if my filters are name="abc" , state="xyz" Applying the above expression i get my query as
select * from SomeTable where name="abc" **AND** state="xyz"
But i want it work like
select * from SomeTable where name="abc" **OR** state="xyz" instead
how should I change it, Please help
Upvotes: 0
Views: 30
Reputation: 25
var result = from a in db.tablename
where a.name=="abc" || a.state== "xyz"
select a;
OR
var result = db.tablename.where(a=> (a.name.Equals("abc")) ||
(a.state.Equals("xyz"));
Upvotes: 1