I used EF 6.0.8 in my project
Here, you will see the example of my code
var searchCriteria = CreateSearchString<T>(model);
if (!string.IsNullOrEmpty(searchCriteria))
{
result = !string.IsNullOrEmpty(searchCriteria)
? enumerable.AsQueryable().Where(searchCriteria, model.Search.Value.ToLower())
: enumerable.AsQueryable();
}
"( it.Parent1FirstName.= null && it.Parent1FirstName.ToString().ToLower().Contains("Parent1"))"
I have created dynamic query to filter records based on COLUMN property. see below image.
Query applied to my Enumerable data source BUT it not filtering my data. see below image.
DATABASE SOURCE
Resolved, It was my bad.
I was comparing .toLower()
case only for value not for properties
It's working fine now.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.