Bug when automapping subclasses - code attached
Hi,
I'm having a problem when attempting to automap a model which contains subclasses. The error manifests itself as
Tried to add property 'NPC' when already added.
I've stepped through the code and it looks like it's trying to map the base class of the hierarchy twice which is causing the error. Test project (in VB) attached which reproduces the error against build 636.
Any troubleshooting help would be much appreciated
Thanks
James
- Test.zip 13.9 KB
2 Posted by James Spibey on 20 Apr, 2010 07:54 AM
Still struggling with this one - it looks like it's either mapping the base class twice or that it's failing to identify the subclasses as actual subclasses.
Can anyone help?
3 Posted by James Spibey on 21 Apr, 2010 10:29 AM
I posted a reply to this yesterday but it seems to have been lost. I found one bug in AutoMapper::MapInheritanceTree() where it seems to overwite whatever might have been set as the type's discriminator with the default on.
So this
Should probably be something like
However, this still hasn't fixed the primary problem - can anyone help with that?
4 Posted by James Spibey on 14 May, 2010 11:03 AM
Sorry to keep banging on about this but can anyone offer any help with this problem?
Support Staff 5 Posted by James Gregory on 16 May, 2010 04:44 PM
Hi James, sorry for not getting back to you sooner. Have you by any chance tried the most recent build? We've put in quite a few automapping fixes since you originally asked your question.