Thanx again sbelini!
This PredicateBuilder is excellent!
This is exactly what I was looking for!
Here is what my query ends up looking like:
var predicate = PredicateBuilder.True<EntTs>();
var strings = param.p_text.Split(',');
foreach (string s in strings)
{
var intervals = s.Split('-');
predicate = predicate.Or(ts => ts.p_tsID >= Int32.Parse(intervals[0].Trim()) && ts.p_tsID <= Int32.Parse(intervals[1].Trim()));
}
var query = p_manager.EntTsSet.Where(predicate);
query = query.OrderBy(ts => ts.p_tsID);
Query(query,callback);
And if I use the help from my JetBrains Reshaper, it ends up looking like this:
var predicate = PredicateBuilder.True<EntTs>();
var strings = param.p_text.Split(',');
predicate = strings.Select(s => s.Split('-')).Aggregate(predicate, (current, intervals) => current.Or(ts => ts.p_tsID >= Int32.Parse(intervals[0].Trim()) && ts.p_tsID <= Int32.Parse(intervals[1].Trim())));
var query = p_manager.EntTsSet.Where(predicate);
query = query.OrderBy(ts => ts.p_tsID);
Query(query,callback);
Just love it!