Is it possible to make "Entity SQL"-like queries against DataObjects model?
It is required to allow our end-users write their own custom queries to data storage.
[Add] Direct SQL query not suitable in my case because I need to manage stuff like user permissions at ORM-level but not at database level.

asked Dec 09 '10 at 05:38

vecs's gravatar image


edited Jan 04 '11 at 16:03

Sergey's gravatar image


One Answer:


Unfortunately, "Entity SQL" approach is not supported, but there is a good alternative: try using Dynamic LINQ library to build LINQ queries from user-written query strings, I suppose it will help.

answered Dec 09 '10 at 10:05

Dmitri%20Maximov's gravatar image

Dmitri Maximov

AFAIK, Dynamic LINQ allows to define only expressions inside .Where, .OrderBy, .Select, etc., but author needs to evaluate the whole LINQ query.

The easiest way to implement this is to use CSharpCodeProvider to compile the query dynamically at runtime.

(Dec 09 '10 at 12:54) Alex Yakunin Alex%20Yakunin's gravatar image

Thank you. Most likely this is only way in my case.. Main imperfection of this approach is that CodeDomProvider compiler seems doesn`t available under Silverlight.

(Dec 10 '10 at 08:34) vecs vecs's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA