Take Northwind as example.
My goal is to use Linq to Entity to search Employees dynamically.
My expression maybe:
Expression<Func<Employee, bool>> exp= em => em.EmployeeID > 2;
Here the operator '>'
is selected by combobox at runtime, and it may be '<', '=', '<>', 'contains' and so on.
My question is, how to build the expression dynamically with the operator selected?
One important thing, no selective statements allowed, such as 'if' and 'switch'.
Any answer is appreciated.