0

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.

3 Answers 3

2

Does Dynamic LINQ do what you need?

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

Sign up to request clarification or add additional context in comments.

2 Comments

next time I'll be 11 seconds faster!
Thanks for the feedback Jon. I think it would, however, I'm struggling with the implementations thereof based on the examples I have seen and tested. What I want is to take the input of the user which would conform to what I've said above and translate it into this: E.g var query = from db.Table.Where ("Field1 = ?? And Field2 = ??).Select(). I hope this gives you more information as to what I'm hoping to achieve.
0

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

1 Comment

Thanks for the feedback Jeremy. The LinqPAD would be an excellent option for a developer or an experience BA, but would not be ideal for end user. I've downloaded a source code "Modifying LINQ Expressions with Rewrite Rules" which I'm going to give a go.
0

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

1 Comment

Thanks for the feedback Carsten. Yes, you are correct, it can be done in sql as I've done it using dynamic sql. I would interpret the string and then execute the sql. I'm just trying to explore an alternative to sql so that I can have control over the objects I'm creating, which also make it easier to debug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.