Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This is sample code from the rewrite of my blog.
- ## This is what the mapping would look like
- Mapper.CreateMap<BasicPostInfo, SelectListItem>()
- .ForMember(dest => dest.Text, opt => opt.MapFrom(src => src.Title))
- .ForMember(dest => dest.Value, opt => opt.MapFrom(src => src.Id));
- ## The execution in the controller.
- var vm = new BlogManageViewModel();
- vm.DraftPosts = Mapper.Map<List<BasicPostInfo>, List<SelectListItem>>(basicPostInfoData.GetDraftPosts(group.Id));
Add Comment
Please, Sign In to add comment