This appears to be a bug where MapLeftKey and MapRightKey are not mapping HasMany and WithMany respectively but instead flipping this mapping around. This seems to be a regression for 4.3.1 to 5.
Full details are in this SO thread: http://stackoverflow.com/questions/12192679/many-to-many-relationship-left-and-right-keys-flipped-after-entity-framework-5-u/12238096#12238096
Comments: Thanks for looking into this. Interestingly, rolling EF5 back to EF 4.3.1 definitely fixed the error I was seeing.
Full details are in this SO thread: http://stackoverflow.com/questions/12192679/many-to-many-relationship-left-and-right-keys-flipped-after-entity-framework-5-u/12238096#12238096
Comments: Thanks for looking into this. Interestingly, rolling EF5 back to EF 4.3.1 definitely fixed the error I was seeing.