You can build the expression manually as follows:
// First resolve the used table according to given type Table<T> table = database.GetTable<T>(); // Get the property according to given column PropertyInfo property = typeof(T).GetTypeInfo().GetDeclaredProperty(column); //Func<Data,Data> expressionHere ParameterExpression lambdaArg = Expression.Parameter(typeof(T)); Expression propertyAccess = Expression.MakeMemberAccess(lambdaArg, property); Expression propertyEquals = Expression.Equal(propertyAccess, Expression.Constant(value, typeof(P))); Expression<Func<T, bool>> expressionHere = Expression.Lambda<Func<T, bool>>(propertyEquals, lambdaArg); // Select all items that match the given expression List<T> objectList = table.Where(expressionHere).ToList<T>(); // Return the filled list of found objects return objectList;
Georg source share