-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automapper tries to map private class #105
Comments
I guess that this particular scenario just wasn't tested. But you're making a point, I think it would be a good default to use only public classes out of the box and be able to override this behaviour at will. I'll take this one in, unless someone has other suggestions |
I agree, I can't see why a private nested class should be mapped by default. @chester89 if you're happy to work on this, that's great; I think it should just be a case of pulling @doerig's changes into the |
I'll get to it |
it seems to me that ability to map private non-nested classes was intended, but private nested classes wasn't |
I've got a question - does this change need to be reflected in documentation somewhere? |
I think I got it working - but one test fails, it says public nested class shouldn't be automapped by default |
So with this change, no nested classes would be mapped by default? As for docs, there isn't any mention of nested classes in the docs currently; it might be worth adding a note to the automapping wiki page when this is resolved. Just so we've got the behaviour explicitly stated somewhere. Thanks for your help on this. |
What I did is completely ignored only private nested classes when doing automapping. Public and protected nested classes are being mapped. Is this the desired behaviour? May be we should exclude protected classes also |
After Upgrading from FNH 1.2 to 1.3 my project threw some runtime exceptions. It turned out that fnh 1.3 tries to map a private nested class. Is this intended behaviour or a bug?
I fixed the problem within the AutomappingConfiguration (checking for IsPublic).
Simplified class-setup:
The text was updated successfully, but these errors were encountered: