Mapping Fields to the Same Columns

Thread is closed for posting
2 posts, 0 answers
  1. Henk
    Henk avatar
    114 posts
    Member since:
    Apr 2006

    Posted 12 Feb 2010 Link to this post

    Hi All,

    I have created a Silverlight application with an ADO.NET Data Service (created with de Data Service Wizard).
    In my model I have a class A which has a reference to class B. In class A I have two fields mapped to the same column in the database. One field is a simple field (The ID field of referenced class B). The other field is a reference to class B.
    In one case I want to insert a new object A. I only have the ID value available of an existing object B I want to reference in my new object A.
    When I create my new object A, I fill only the simple field (The ID field available in class A).
    If I look in the database after saving the changes the value of the mapped column in the database is NULL.
    In the On-line manual I read the section about "Mapping Fields to the same columns". There you say "Simple fields are selected before reference fields". Is this true?
    How can I fill the reference of existing Object B in my new Object A when I only have the value of the ID field available of the existing object B?

    Thanks.

  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 17 Feb 2010 Link to this post

    Hi Henk,

    Can you please provide us with the code you are using for creating and inserting an object from a given class as well as the mapping of that class? We have tested here locally inserting objects that have only their id reference set and everything worked out fine. Please note that an exception might occur if you first insert an object that has only its ID reference set but not the object reference, and then you attempt to execute scope.Retrieve() on that object. This bug has been fixed and will be available in our next release. We are not aware of any other bugs.

    Greetings,
    Petar
    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.
Back to Top