Skip to content

Conversation

@jbogard
Copy link
Contributor

@jbogard jbogard commented Sep 26, 2018

Per #2795 discussion

@jbogard jbogard added this to the v.Next milestone Sep 26, 2018
@lbargaoanu
Copy link
Contributor

A small thing, but I wouldn't mind seeing UseValue gone :)

@jbogard
Copy link
Contributor Author

jbogard commented Sep 27, 2018

Ha, oh right! Because we used to force people to only use MapFrom from properties.

I'd be OK with that,

@lbargaoanu
Copy link
Contributor

OK, it should be simple to do. I'll open a PR whenever :)

@jbogard
Copy link
Contributor Author

jbogard commented Sep 27, 2018 via email

@lbargaoanu
Copy link
Contributor

Nice :)

@jbogard jbogard merged commit 463305f into master Sep 27, 2018
@jbogard jbogard deleted the consolidate-map-from branch September 27, 2018 13:24
@yhnavein
Copy link

yhnavein commented Nov 30, 2018

Ok, fantastic. I have replaced ResolveUsing with the MapFrom, but how should I deal nicely with the An expression tree lambda may not contain a null propagating operator error?
That was the whole purpose of using ResolveUsing for me, as it was short and dandy. And I have plenty of null checking in my mappings.

- .ForMember(dest => dest.UserId, opts => opts.ResolveUsing(src => src.User?.Id))
+ .ForMember(dest => dest.UserId, opts => opts.MapFrom(src => src.User?.Id))

I find the following solution unacceptable:

 .ForMember(dest => dest.UserId, opts => opts.MapFrom(src => src.User == null ? (long?) null : src.User.Id))

Is there any other way to deal with this breaking change?

@lbargaoanu
Copy link
Contributor

Check the upgrade guide.

@lock
Copy link

lock bot commented May 5, 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 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants