Lindsay Fisher
Lindsay Fisher

Reputation: 43

Building Dynamic Linq Query From a string

I'm a new to the linq technology and I'm wondering if it can solve my problem.

I need to build an application where a user can write high level sql like sentences or statements(e.g. table.field.field.aggregation), which then needs to be interpreted and then executed. I've done searches on the web and found many Linq technology options, however I've not seen anyone with a similar problem or I don't understand the proper use of the different Linq technology. My approach might be incorrect and I need to rethink my design. I hope I gave enough information.

Upvotes: 0

Views: 360

Answers (3)

Random Dev
Random Dev

Reputation: 52270

sql was build for this scenario but I guess you want your own. If the other answers are just not good enough then this will end in your own interpreter for your language and is not easy to explain in just a few sentences. Try searching for Domain-Specific-Languages

Upvotes: 0

Jeremy Thompson
Jeremy Thompson

Reputation: 65544

I think that application has already been built: LinqPAD by Joseph Albahari (C# MVP)

Upvotes: 0

Jon Skeet
Jon Skeet

Reputation: 1500055

Does Dynamic LINQ do what you need?

If not, have you considered taking the snippet and simply compiling it as C# using CSharpCodeProvider?

Upvotes: 2

Related Questions