Beispiel #1
0
        public IEnumerable <CommentViewModel> GetAllComment()
        {
            IEnumerable <CommentDTO> commentDTOs = travelService.GetAllCommentList();

            Mapper.Initialize(cfg => cfg.CreateMap <CommentDTO, CommentViewModel>());
            var comments = Mapper.Map <IEnumerable <CommentDTO>, List <CommentViewModel> >(commentDTOs);

            return(comments);
        }