Hey All,
Well I got a little rest this weekend and dug at the problem a little
more today. It looks like the problem is that if you have more than
one self-referencing relationship in the same table things get messed
up. All I ended up needing to do was add a check to see if the tables
the relationship were supposed to tie to had the same name and now it
is working. So it looks like this in the
BiDirectionalManyToManyPairingVisitor where the last line there is
what I added.
var potentialOtherSides = relationships
.Where(x => x.ContainingEntityType ==
mapping.ChildType && x.ChildType == mapping.ContainingEntityType
&& !string.IsNullOrEmpty(x.TableName) && x.TableName.Equals
(mapping.TableName, StringComparison.Ordinal));
I'm sure James has a fancier way of fixing this issue, but this looks
like it will work for me right now.
Bryan