Skip to content
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

Profiles and RecognizePrefixes #421

Closed
dmunch opened this issue Nov 26, 2013 · 3 comments
Closed

Profiles and RecognizePrefixes #421

dmunch opened this issue Nov 26, 2013 · 3 comments

Comments

@dmunch
Copy link

dmunch commented Nov 26, 2013

I'm not the orginal author of http://stackoverflow.com/questions/19240718/automapper-profiles-not-working , but I'm using his words since I just stumbled upon the same missbehaviour:

Does anyone know why this works:

Mapper.Configuration.RecognizeDestinationPrefixes("Foo");
Mapper.CreateMap<A, B>();

But this doesn't:

Mapper.CreateProfile("FooPrefix").RecognizeDestinationPrefixes("Foo");
Mapper.CreateMap<A, B>()
      .WithProfile("FooPrefix");
@jbogard
Copy link
Member

jbogard commented Jan 27, 2014

Not sure, I'll get this fixed in 3.2.

@jbogard
Copy link
Member

jbogard commented Apr 9, 2014

This is because the profile is assigned too late - you need to call CreateMap after CreateProfile to make sure that the prefixes checked appropriately. After RecognizeDestinationPrefixes, call CreateMap.

Alternatively, create a Profile class directly.

@lock
Copy link

lock bot commented May 8, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants