This is a migrated thread and some comments may be shown as answers.

Cannot Create oData Service From View

2 Answers 90 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
DEX
Top achievements
Rank 1
DEX asked on 03 May 2013, 04:10 PM
So I have Oracle in the backend and an OpenAccess ORM generated with a View in it. The View in the database does NOT have a PK constraint but the main underlying table does and Oracle will not let me add a PK to the view because it recognizes the PK from the underlying table and tells me that I can only have one PK. According to the OpenAccess documentation........

"By default, if your view doesn't have a primary key, the corresponding entry in the Add OpenAccess Service wizard is disabled. If you want to expose a view through a service, you need to specify a primary key in the Visual Designer."

So I did this. The Visual Designer shows the little key signifying that the column is a PK. But I sill cannot add the View to the entity collection when trying to create an oData v3 service. I click and click and click on the little checkbox to add it to no avail. I tried clearing Visual Studio cache. I tried rebuilding the solution. I tried I tried clicking harder. I tried crossing my arms and wiggling my nose. I tried a little voodoo magic. Apparently my kung fu is weak today.

Please advise.

2 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Zhivkov
Telerik team
answered on 07 May 2013, 01:57 PM
Hi DEX,

You will have to rebuild the project that contains your RLINQ model before Add OpenAccess Service wizard will be able to see the changes that you have made.
Additionally there can be other issues with the types that you are trying to expose. You can check the validation messages that Add OpenAccess Service wizard generates for each entity that does not pass the validation step by hovering the entity row and inspecting the message in the tooltip that appears.
There is one more thing to consider when working with views - you will not be able to insert, update and delete any items coming from the views.

Please let us know if you were able to resolve the issue and if you need any further assistance you are welcome to ask your questions either here in the forums or in our customer support system.

Regards,
Viktor Zhivkov
the Telerik team
Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
0
DEX
Top achievements
Rank 1
answered on 07 May 2013, 03:15 PM
Awesome! You rock!

I was unaware of the tooltip. I hovered over the row and the tooltip told me that the view had a nullable char which is incompatible with WCF Data Services. I changed the database to not allow nulls for that column, regenerated the model, and successfully created the oData service.

Thank you so much.
Tags
Development (API, general questions)
Asked by
DEX
Top achievements
Rank 1
Answers by
Viktor Zhivkov
Telerik team
DEX
Top achievements
Rank 1
Share this question
or