mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-22 05:22:57 +01:00
OR filtering tests - multiple properties (#8)
This commit is contained in:
parent
b041c0baff
commit
3e671f56ad
@ -27,7 +27,19 @@ namespace Sieve.Models
|
||||
var value = new List<IFilterTerm>();
|
||||
foreach (var filter in Filters.Split(','))
|
||||
{
|
||||
value.Add(new FilterTerm(filter));
|
||||
if (filter.StartsWith("("))
|
||||
{
|
||||
var filterOpAndVal = filter.Substring(filter.LastIndexOf(")") + 1);
|
||||
filter = filter.Replace(subfilterOpAndVal, "").Replace("(", "").Replace(")","");
|
||||
foreach (var subfilter in filter.Split("|"))
|
||||
{
|
||||
value.Add(new FilterTerm(subfilter + filterOpAndVal))
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value.Add(new FilterTerm(filter));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user