I want to apply few conditions in my linq query. My scenario is I am fetching records from a table and if user select some criteria then apply condition according to. So what i want to do is
var linq = from p in Post select p
//now if user apply that condition
string id = "1"; //Here 1 is what user inputs
string condition = where p.id == id
//then it executes query like this
linq = from p in Post condition select p
Can i do this in linq if yes then how