This question is locked. New answers and comments are not allowed.
In a small sample application I have a managed many-to-many relation between classes A and B. In which A contains a IList<B> and B contains a IList<A>.
This relation is translated in database by 3 tables, A, B and A_B, A_B being the relation table, containing both IDs of A and B. Nothing strange so far.
After creating a few objects of types A and B I checked the DB tables and everything was correct. A and B tables contained the new objects and A_B contained relations between all of those, which is also correct.
The problem is that when loading an object of type A its property IList<B> is null, the same happens on the opposite direction, if I load an object of type B its IList<A> is null. I though this could be a simple fetch group problem, but if I refer to any of the collection properties in a LINQ query, an exception is thrown and its message leads me to believe that it is due to the collection reference.
Is there any known issue with many-to-many relations or any aspect I may have overlooked on its implementation?
This relation is translated in database by 3 tables, A, B and A_B, A_B being the relation table, containing both IDs of A and B. Nothing strange so far.
After creating a few objects of types A and B I checked the DB tables and everything was correct. A and B tables contained the new objects and A_B contained relations between all of those, which is also correct.
The problem is that when loading an object of type A its property IList<B> is null, the same happens on the opposite direction, if I load an object of type B its IList<A> is null. I though this could be a simple fetch group problem, but if I refer to any of the collection properties in a LINQ query, an exception is thrown and its message leads me to believe that it is due to the collection reference.
Is there any known issue with many-to-many relations or any aspect I may have overlooked on its implementation?