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
CodePudding user response:
Resolved, It was my bad.
I was comparing .toLower()
case only for value not for properties
It's working fine now.