Mapper.Map within config.CreateMap wont work in V.5

31 views
Skip to first unread message

zacho...@gmail.com

unread,
Aug 2, 2016, 11:44:23 AM8/2/16
to AutoMapper-users
Inside my MapperConfiguration i have:

config.CreateMap<StatuteDocument, StatuteViewModel>()
                    .ForMember(x => x.Title, y => y.MapFrom(x => x.OriginalTitle))
                    .ForMember(x => x.HasFullText, y => y.MapFrom(x => x.FulltextStatus == FulltextStatus.Available))
                    .ForMember(x => x.FullText,
                        y => y.MapFrom(x => (x == null || !x.XmlDoc.Any()) ? string.Empty : x.XmlDoc[0].XmlDoc))
                    .ForMember(x => x.ParallelCitations,
                        y => y.MapFrom(src => new List<CitationViewModel> { Mapper.Map<CitationViewModel>(src.Citation) }));

The last .ForMember for ParallelCitations causes issues in the code when i call the Map within the API, anybody know how to refactor this for V.5. thanks. 

Jimmy Bogard

unread,
Aug 2, 2016, 2:41:32 PM8/2/16
to automapp...@googlegroups.com
GitHub issue please?
--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zac Hobday

unread,
Aug 3, 2016, 4:58:14 AM8/3/16
to automapp...@googlegroups.com

--
You received this message because you are subscribed to a topic in the Google Groups "AutoMapper-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automapper-users/G3z-fBm6EOc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automapper-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages