Fix for issue #113 #115

merged 1 commit into from Apr 10, 2013

3 participants


Classes deep in the inheritance tree were not being Automapped


Problem is in AutoPersistanceModel.AddMapping.

It calls GetTypeToMap, which returns the root base class. The base class gets mapped multiple times - but the type that was passed in never gets mapped at all.

This change fixes my problem, and all the unit tests still pass. But I'm somewhat suspicious about the GetTypeToMap method, which always (as far as I can tell) returns the root base class, no matter how many levels of inheritance are in between.

But I have multiple levels of inheritance, and all the classes are now being mapped, so I obviously don't understand how it works. Might be worth a look, though.

Also, I looked at the unit tests, and did not see any that checked for more than one or two levels of inheritance. Tried to create some, but without success.

Anyway, please review and add to the trunk if it's up to snuff.


-Tom Bushell


Hey Tom. I hate this area of the codebase, it's very vague as to how it should behave, so I understand your hesitance/suspicion. I'll review and apply.

@chester89 chester89 merged commit 1daf18a into jagregory:master Apr 10, 2013

Thanks for merging this!

Were you able to add any unit tests that tested deeper inheritance levels?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment