I am trying to create a some kind of dynamic loader for my models where I can specify which properties I need, the main purpose of it is to create a REST API
which provides dynamic information as JSON
for individual models.
The API
would be accessed by e.g.
/api/model?id=581D1393-3436-4146-A397-E47CF5419453&fields=foo,bar,baz
For this purpose I used the Dynamic LINQ
like described in ScottGu's Blog, the problem is that I need to do queries over multiple tables with joins and load data from different tables, which I can't do in this case, as far I know.
Now I use ObjectQuery<DbDataRecord>
approach with Entity SQL
where I can create a query however I want, but in this case I lose compiler validation and it is harder to refactor.
My question is, is there a there a best practice scenario for this kind of problem? And is it may be simpler to achieve with some other ORM
?
Greetings
Russlan A.