title: C# Using Linq Query with where clause as variable on dataTable
body: <p>I have seen different examples and questions but I cannot figure how to write this query successfully. The where clause condition is in filter.condition   </p>
  
  <pre><code>  private object[] GetValueFromLookup(MultipleKeyConditionBuilder filter, string lookupValueField, DataTable datatableLookup)
      {
  
          Func&lt;int, string&gt; whereClause = test =&gt; filter.Condition;
  
          IEnumerable&lt;object&gt; query =
          from rows in datatableLookup.AsEnumerable().Where(whereClause)
          select rows.Field&lt;object&gt;(lookupValueField);
          return query.ToArray();
  
      }
  </code></pre>
  
  <p>I am getting this error. I have tried different things but unfortunately I cannot understand how to solve it. </p>
  
  <blockquote>
    <p>cannot convert from 'System.func (int,string)' to 'System.func(system.Data.DataRow,int,bool)'  </p>
  </blockquote>
  
  <p>MultipleKeyConditionBuilder.This function gives the filter condition. It is defined as.   </p>
  
  <pre><code>public MultipleKeyConditionBuilder(List&lt;string&gt; sourceKeyFieldsList, List&lt;string&gt; referenceKeyFieldsList, DataRow sourceRow) {} 
  </code></pre>
  
  <p>filter.Condition gives a string for example "Project_id = 255454" </p>