Page 1 of 1

RIA Services - Many to Many

Posted: Tue 25 May 2010 17:10
by RobIntechnica
Hi

I'm Using RIA Services PDC 2009 to query my dotConnect for Oracle entity diagram, but I can't seem to access a many to many relationship. It works fine for one to many on the client. Many to many works on the server though.

In domain service on server this is fine:-

Code: Select all

 private void Test()
        {
            XYZ_FILE file = new XYZ_FILE();

            var x = file.XYZ_FOLDER;

        }
        
In Silverlight client this gets an error on the 2nd line:-

Code: Select all

 private void Test()
        {
            XYZ_FILE file = new XYZ_FILE();

            var x = file.XYZ_FOLDER;

        }

Error 7 'XYZDataModel.XYZ_FILE' does not contain a definition for 'XYZ_FOLDER' and no extension method 'XYZ_FOLDER' accepting a first argument of type 'XYZDataModel.XYZ_FILE' could be found (are you missing a using directive or an assembly reference?)

What could be the problem? Thanks

Posted: Fri 28 May 2010 08:33
by AndreyR
Unfortunately, there is no support for many-to-many relationships in RIA Services. Take a look at this link.
I recommend you to take a look at this article. Hope this helps.

Posted: Fri 28 May 2010 08:40
by RobIntechnica
Thanks very much for the links. Adding to the many to many wasn't a problem, it was only when I came to delete. I've worked round this by enabling cascade delete at the database level and altered the relationship in the model to reflect this.

I'll try the adding an extra column approach if I need this in future.