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

Upgrade to AutoMapper 5.0.2 issue #18

Closed
dmdymov opened this issue Oct 11, 2016 · 10 comments
Closed

Upgrade to AutoMapper 5.0.2 issue #18

dmdymov opened this issue Oct 11, 2016 · 10 comments
Labels
Milestone

Comments

@dmdymov
Copy link

dmdymov commented Oct 11, 2016

I'm trying to upgrade my project from AutoMapper 4.1.1 / AutoMapper.Collection 1.1.2 to AutoMapper 5.0.2 / AutoMapper.Collection 2.0.1. I have a scenario which works fine with old dlls and I get unexpected null as a result of mapping with new dlls.

Gist with issue code.

Is this a bug or I am missing something?

@TylerCarlson1
Copy link
Member

I think this is a bug with AutoMapper 5.0.2 and you need to upgrade that. When source or destination are null it defaults back to the CollectionMapper in AutoMapper to do the mapping.

I know Collection mapping has been updated recently in AutoMapper.

@dmdymov
Copy link
Author

dmdymov commented Oct 11, 2016

For the latest AutoMapper 5.1.1:

System.MethodAccessException at Mapper.Initialize:
"AutoMapper.Mappers.EquivlentExpressionAddRemoveCollectionMapper.IsMatch(AutoMapper.TypePair)" couldn't get access to "AutoMapper.Configuration.PrimitiveExtensions.IsEnumerableType(System.Type)"

Any thoughts on this?

@TylerCarlson1
Copy link
Member

Now THAT is a bug that I need to fix.

I'll try to make a build that fixes it that works in 5.1.1 by the end of the week.

@TylerCarlson1
Copy link
Member

2.1.0 Should fix this issue.

Removed as much of AutoMapper's internal code I was using before, so hopefully only refactors of the API will only require updates.

@dmdymov
Copy link
Author

dmdymov commented Oct 12, 2016

Yes, there's no exception with 2.1.0. But null as a result of mapping is still there. I think I'll try to create an Automapper issue.

@dmdymov
Copy link
Author

dmdymov commented Oct 12, 2016

I am here again. AutoMapper issue.

@lbargaoanu :

Then I guess @TylerCarlson1 should help you here.

What should I do know? This is getting a bit weird.

@TylerCarlson1
Copy link
Member

I'll have to look into it some more then.

@TylerCarlson1
Copy link
Member

Yea when updating the logic changed and the null check changed and caused the functionality to break for nulls.

@TylerCarlson1
Copy link
Member

2.1.1 should fix the original issue. Wrote unit tests for it.

@dmdymov
Copy link
Author

dmdymov commented Oct 17, 2016

Everything is OK now, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants