OpenAccess Doman Service and relationships

2 posts, 0 answers
  1. mariob
    mariob avatar
    15 posts
    Member since:
    May 2007

    Posted 06 May 2011 Link to this post

    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. 

  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 09 May 2011 Link to this post

    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.
  3. DevCraft banner
Back to Top