Page 1 of 1

Using EDML with RIA and Silverlight - Dual relationship

Posted: Tue 09 Feb 2010 18:15
by RobIntechnica
Hi

I've been building a Silverlight application using dotConnect Oracle Entities and RIA Services.

This is working fine, provided all associations are named the same as the foreign keys that they're based on and that the Naming Rules are set to leave everything unchanged. Also, each association needs to be edited so that the Child Navigation Property does not have an 's' appended to it, which it does for some reason even though Naming Rules are set to unchanged.

Anyway, the only problem I've not been able to overcome is when tables have two relationships between each other. Because the first relationship has the Parent Navigation Property and Child Navigation Properties set to the exact physical table names, the second relationship cannot use these as well. If you try you get a message box saying:-

---------------------------
Association Editor
---------------------------
An item named 'USERS' already exists. Please choose a different name.
---------------------------
OK
---------------------------

Is there any workaround for this. The error message when the second relationship doesn't have matching names is:-

Error 2 Association named 'REPORTS_USERS' defined on entity type 'ReportingDataModel.REPORTS' is invalid: ThisKey property named 'USER_ID' cannot be found.

Thanks

Posted: Wed 10 Feb 2010 14:46
by AndreyR
Entity Framework validation does not allow to have the identical names for 2 associations, so this is designed behaviour.
As a solution I recommend you to implement special metadata classes like it is described in the
Associations section of the following article:
http://www.scip.be/index.php?Page=ArticlesNET30