using System.Collections.Generic;
using System.Linq.Dynamic;
public static void Main()
var lstContacts = new List<Contact>{
new Contact{Id = 1, Active = true, Name = "Chris"},
new Contact{Id = 2, Active = true, Name = "Scott"},
new Contact{Id = 3, Active = true, Name = "Mark"},
new Contact{Id = 4, Active = false, Name = "Alan"}};
string columnName = "Active";
string crit=String.Format("{0} == {1}", columnName,true);
string columnName2 = "Name";
string searchTerm ="Mark";
string crit2=String.Format("{0} == {1}", columnName2,"\""+searchTerm+"\"");
Console.WriteLine(crit2);
List<Contact> results = lstContacts.Where(crit2).ToList();
foreach (var item in results)
Console.WriteLine(item.Id.ToString() + " - " + item.Name.ToString());