Page 1 of 1

Cannot remove ManyToMany item

Posted: Thu 17 Feb 2011 15:56
by keeper
Hello, I have two entities: Utente and Gruppo which are ManyToMany related.

In the designer I can create the entities correctly: they are linked with a dotted line showing a "*" on both sides.

When I try to delete a relation this way:

Code: Select all

        public bool RemoveUserFromGroup(string user, string group)
        {
            Utente utente = context.Utenti.SingleOrDefault(u => u.UserName == user);
            Gruppo gruppo = context.Gruppi.SingleOrDefault(g => g.UserGroup == group);
            if (utente == null || gruppo == null) return false;
            utente.Gruppi.Remove(gruppo);
            context.SubmitChanges();
            return true;
        }
I get an exception saying: "Could not modify EntitySet".
What am I doing wrong?
Thanks

Posted: Fri 18 Feb 2011 15:00
by StanislavK
Thank you for the report, we have reproduced the issue. We will analyze it and inform you about the results.

Posted: Fri 22 Apr 2011 09:38
by StanislavK
This problem was caused by incorrect code generation for many-to-many associations. We have fixed it, and the fix is available in the latest 2.50.22 Beta build of LinqConnect. The new build can be downloaded from
http://www.devart.com/linqconnect/download.html
(the trial version) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/

For more information about the fixes and improvements available in LinqConnect 2.50 Beta, please refer to
http://www.devart.com/forums/viewtopic.php?t=20827

Posted: Tue 03 May 2011 09:22
by keeper
When a final (non-beta) release will be available? I'd rather not install a beta version on a production system...

Posted: Wed 04 May 2011 10:10
by StanislavK
We plan to publish the release in about two weeks. We will post here when it is available.

Posted: Thu 19 May 2011 11:32
by StanislavK
We have released the new 2.50.23 version of LinqConnect. It can be downloaded from
http://www.devart.com/linqconnect/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/

For the detailed information about the improvements and fixes available in LinqConnect 2.50.23, please refer to
http://www.devart.com/forums/viewtopic.php?t=21036