Liz
Liz

Reputation: 261

C#: Runtime Query on Linq-able data

This is basically a "can it be done" question.

If I have a List<SomeObject> is there some way to convert a user's string input into a query that can be run against the List<>? The most obvious example would be having the user enter an SQL query and then running that query on the List<>. I'm not necessarily interested in executing SQL, but I'm wondering if there is some way to run a linq query without hard coding it. I don't really care what the syntax is like.

Upvotes: 1

Views: 119

Answers (1)

BrokenGlass
BrokenGlass

Reputation: 160912

Checkout Dynamic Linq. Sounds like that's what you want.

Upvotes: 2

Related Questions