5
Reply

Is it possible to create query for Linq on columns identified at runtime and not the parameter values?

Hemant Mahajan

Hemant Mahajan

8y
2.7k
0
Reply

    Expression tree can be your option here

    It is not Possible Because of first compiler check and gives an error

    Dynamic LINQ Queries with Expression Trees can be used

    Dynamic LINQ library can be used to achieve this.

    By default its not possible in LINQ, You need you to write your own logic of few hundred lines to achieve this. By doing so it would be possible to possible to pick a column at runtime, also possible to decide filter at runtime. Expression Tree classes can help you achieve this.