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
private object[] GetValueFromLookup(MultipleKeyConditionBuilder filter, string lookupValueField, DataTable datatableLookup)
{
Func<int, string> whereClause = test => filter.Condition;
IEnumerable<object> query =
from rows in datatableLookup.AsEnumerable().Where(whereClause)
select rows.Field<object>(lookupValueField);
return query.ToArray();
}
I am getting this error. I have tried different things but unfortunately I cannot understand how to solve it.
cannot convert from 'System.func (int,string)' to 'System.func(system.Data.DataRow,int,bool)'
MultipleKeyConditionBuilder.This function gives the filter condition. It is defined as.
public MultipleKeyConditionBuilder(List<string> sourceKeyFieldsList, List<string> referenceKeyFieldsList, DataRow sourceRow) {}
filter.Condition gives a string for example "Project_id = 255454"