ZEXSM / OData.QueryBuilder

OData.QueryBuilder - library for creating complex OData queries (OData version 4.01) based on data models with linq syntax.
MIT License
71 stars 31 forks source link

Add parenthesis on filter #100

Open sfreidahl opened 2 years ago

sfreidahl commented 2 years ago

When combining several filters by calling Filter() multiple times, they will be joined by "and" which is "fine". The issues comes when there's an or in one of the filters, which will produce unexpected results. e.g. Filter(x => x.Foo == "some string") Filter(x => x.Bar == 1 || x.Bar == 2 ) Should be: "(Foo eq 'some string') and (Bar eq 1 or Bar eq 2)" But will be: "Foo eq 'some string' and Bar eq 1 or Bar eq 2"