i am using the ObjectScope of telerik open access.
How can i select data by sending the table name as parameter using linq query ?
thanks
3 Answers, 1 is accepted
0
Serge
Telerik team
answered on 15 Apr 2011, 04:18 PM
Hi bin,
Unfortunately at the moment it is impossible to retrieve information based on the table name. However it should be possible to retrieve the persistent type name based on the table name using the metadata model that is available trough the scope.
However this might only help you if you are using OQL to retrieve data.
I hope this is helpful.
All the best,
Serge
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
This is of interest to me as I want to query a table that is not part of the DomainModel.
Using IObjectScope.GetSqlQuery will be database depentant and I would like to solve this without having diffrent queries depending what the backend type is.
Has anyone a workaround ?
0
Alexander
Telerik team
answered on 17 May 2011, 05:23 PM
Hello Bjössi,
I am afraid that the only way to retrieve information from a table which is not part of the model is to create a stored procedure in the database which returns the needed data. Then you can add this stored procedure to your model and execute it as a method of the OpenAccessContext instance. This method would return an object array which you can easily traverse to get the data.
Regards,
Alexander
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.