How can I create a console application that allows me to inject LINQ expressions and my program will execute them?

How can I write a console application that asks me and allows me to inject LINQ expressions and it spits out the results of that LINQ query?

What would be the easiest way to parse or evaluate the input string as a LINQ expression?

+1


source to share


3 answers


A console application is inconvenient to use for several reasons. Try LinqPad



+2


source


use the Dynamic LINQ Query Library, see this



+1


source


I wrote a LinqFilter for something similar for this purpose. It does not parse LINQ query expressions by itself, but rather feeds the code to the C # v3.5 compiler via Microsoft.CSharp.CSharpCodeProvider to compile into dynamic assembly and execute the compiled method containing the query. If you were looking for a more interactive approach to developing LINQ queries over databases, LinqPad would be a better tool.

+1


source







All Articles