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

OpenAccess Doman Service and relationships

1 Answer 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mariob
Top achievements
Rank 1
mariob asked on 06 May 2011, 07:36 AM
Hi!

So, I created a model connected to Firebird database and then I created RIA Services project and added OA Domain Service in it. Lightswitch can consume that service and selecting works as expected. Updates, on the other hand, throws error: Value cannot be null. Parameter name: sourceMemberNames (I've seen this error in one more thread, but not resolved yet).

But what I want to ask - how to persist relationship from model through ria services to Lightswitch? Currently, Lightswitch does not recognize any relationship even though they are defined in the model. I understand that some attributes are required to do that, but if I add them manually in genereated classes in model project - they will get overwritten as soon as I change something in the model. 
Generating them in ria services library project as partial classes seems quite cumbersome (especially I would have to learn t4 code generation which is not something I want to do just to add relationship which is already defined). 

I think it would be much better to add property in model for navigation properties, something like "Include in data services" or add an option in Data Services Wizard to generate required code to persist navigational properties. I think a property in model would be nice, since it is not always required to pull all data. 

Any thoughts on this?

Thanks, 

Mario B. 

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 09 May 2011, 04:37 PM
Hi mariob,

 What you can do is use metadata classes(buddy classes) to define some custom attributes through class extensions. This way they will not be overwritten on each code generation. Additional information regarding the metadata classes can be found here.
Currently we are working on improving the RIA wizard to allow the automatic generation of those classes(along with the most attributes needed). The wizard should be available with one of our next service packs.

Greetings,
Petar
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
General Discussions
Asked by
mariob
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or