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

Multiple references between 2 objects

3 Answers 51 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.
Stijn
Top achievements
Rank 1
Stijn asked on 20 Oct 2014, 12:18 PM
I have a database model where class "TEAM" has a list of items of type "MEMBER", with a reverse navigation property in class "MEMBER" to "TEAM". Class "TEAM" also has 4 more references to specific instances of Class "MEMBER", for example 'TeamLeader', 'PublicRelations', etc ....". These 4 references don't have a specific reverse navigation property, as it'll always be the same as the one from the list.

I can't get my code to work however. When adding 'IsManaged' to the list property, the list is properly managed, but the 4 other references behave in a bizarre way. When removing IsManaged from the list, the 4 single references work fine, but the List is not properly filled.

I'm using the latest version of the NuGet packages.

Kind regards,
Stijn


3 Answers, 1 is accepted

Sort by
0
Boris Georgiev
Telerik team
answered on 23 Oct 2014, 12:42 PM
Hi Stijn,

If I understand correctly your scenario and model you have two classes looking like this:

class Team
- Id - Property
- TeamLeaderId - Property
- PublicRelationId - Property
- Members - Navigation
- TeamLeader - Navigation
- PublicRelation - Navigation

class Member
- Id - Property
- TeamId - Property
- Team - Navigation

and Associations:
Team.TeamLeaderId - Member.Id - 1:n
Team.PublicRelation - Member.Id - 1:n
Team.Id - Member.TeamId - n:1

In this scenario, the navigation collection property Team.Members and the navigation reference properties Team.TeamLeader and Team.PublicRelation are based on different columns in the database, which means that the IsManaged collection could be impaired because there are 2 or more associations between these two classes. So in this case we would recommend you to not use IsManaged flag of the navigation collections and manage the navigation properties by your own.

I hope that helps. If this is not your scenario, could you please share more details about your model?

Regards,
Boris Georgiev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Stijn
Top achievements
Rank 1
answered on 24 Oct 2014, 06:34 AM
Hello

Thanks for the response. So currently having Telerik manage the navigation properties when having multiple references is not possible. Is this however a bug or feature that might be fixed/added in future versions?

Kind regards,
Stijn
0
Boris Georgiev
Telerik team
answered on 24 Oct 2014, 03:45 PM
Hello Stijn,

This is a limitation of Telerik Data Access and at the moment supporting IsManaged for multiple relations between two classes is not in our backlog list.

If any other questions arise, do not hesitate to contact us again.

Regards,
Boris Georgiev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Development (API, general questions)
Asked by
Stijn
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Stijn
Top achievements
Rank 1
Share this question
or