I am trying to write a c# lambda expression with a dynamic where condition and trying to understand the type of content inside where condition. How can I call that content inside where clause dynamically?
I am taking string here for example
string query1 = "p=>p.id == 1 && p.name==\"abc\" ";
string query2 = "p=>p.id == 2 && p.name==\"def\" ";
//Normal Lambda Expression:
var details = _db.MyTable.Where(p=>p.id == 1 && p.name=="abc")
//Trying to check these if it works
var details1 = _db.MyTable.Where(query1)
var details2 = _db.MyTable.Where(query2)