public static void ConfigureMapper(IMapperConfigurationExpression config) { config.CreateMap <TripCandidateModel, TripCandidate>(); config.CreateMap <DestinationCandidateModel, DestinationCandidate>(); config.CreateMap <PhotoSessionModel, PhotoSession>(); config.CreateMap <HighliteTopicViewModel, HighliteTopic>(); config.CreateMap <HighliteTopic, HighliteTopicViewModel>(); config.CreateMap <HighliteItemViewModel, IHighliteItem>(); config.CreateMap <IHighliteItem, HighliteItemViewModel>(); ServiceMapper.ConfigureMapper(config); // to Album config.CreateMap <HighliteTopic, AlbumSectionViewModel>(); config.CreateMap <Destination, AlbumSectionViewModel>(); config.CreateMap <Location, AlbumSectionViewModel>(); config.CreateMap <IHighliteItem, AlbumItemViewModel>(); config.CreateMap <Photo, AlbumItemViewModel>(); // from album service to VModel config.CreateMap <AlbumItem, AlbumItemViewModel>(); config.CreateMap <AlbumItemViewModel, AlbumItem>(); config.CreateMap <AlbumSection, AlbumSectionViewModel>(); config.CreateMap <AlbumSectionViewModel, AlbumSection>(); config.CreateMap <Album, AlbumViewModel>(); config.CreateMap <AlbumViewModel, Album>(); }
public override void Configure(MvvmConfiguration config) { base.Configure(config); ServiceMapper.RegisterObjects(config.IoC); Mapper.Initialize( cfg => { ServiceMapper.ConfigureMapper(cfg); ConfigureMapper(cfg); }); }