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

Mapping Fields to the Same Columns

1 Answer 84 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.
Henk
Top achievements
Rank 1
Henk asked on 12 Feb 2010, 02:43 PM
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.

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 17 Feb 2010, 07:58 PM
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.
Tags
General Discussions
Asked by
Henk
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or