Pankaj Kumar

Pankaj Kumar

  • NA
  • 143
  • 29k

How to add dynamic column Linq in where condition using refe

Oct 11 2017 8:39 AM
Add dynamic column Linq in where condition using refelection in c#
 string filterValue = "ABC", filterColumName = "ClientName";
clients = clients.Where(x => x.GetType().GetProperty(filterColumName).GetValue(x).ToString() == filterValue).ToList();
 

Answers (1)