1
Reply

How to add dynamic column Linq in where condition using refe

Pankaj Kumar

Pankaj Kumar

Oct 11 2017 8:39 AM
153
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)