title: How to use a string in the linq where clause?
body: <p>I am trying to send a Linq query as a string to a method to be used in a where clause. Since IEnumerable wouldn't work for this, I have converted my IEnumerable to IQueryable and still it throws error. The following is the code:</p>
  
  <pre><code>public static void  FilterData(string Query)
          {
              if((List&lt;MemberMaintenanceData&gt;)HttpContext.Current.Session["Allmembers"] != null)
              {
                  //Get the IEnumerable object colection from session
                  var data = (List&lt;MemberMaintenanceData&gt;) HttpContext.Current.Session["Allmembers"];
                  //Convert it to IQueryable
                  IQueryable&lt;MemberMaintenanceData&gt; queryData = data.AsQueryable();
                  //This line doesn't compile!!
                  queryData = queryData.Where(Query);
                  HttpContext.Current.Session["Allmembers"] = queryData.AsEnumerable().ToList();
              }
  
          }
  </code></pre>
  
  <p>I intended passing "a => a.AccountId == 1000" as Query</p>