var predicate = PredicateBuilder.New<Items>(true);
predicate = predicate.Or(i => Convert.ToDateTime(i.Entrydate).ToString("M/d/yyyy").Contains(searchText));`
Entrydate
is DateTime?
type so directly I can't able to use .ToString('M/d/yyyy')
string format.
This is not working (exception : Must be reducible node
)
IQueryable<Items> items = Repository.GetItems(orderNo).Where(predicate);
This is working
IQueryable<Items> items = Repository.GetItems(orderNo).ToList().Where(predicate).AsQueryable();
But I don't want to convert the results to list while these are in IQueryable
Please note: I am using Convert.ToDateTime()
method in predicate (dynamic) where condition