public IEnumerable <FotoViewModel> GetAllFoto() { IEnumerable <FotoDTO> fotoDTOs = travelService.GetAllFotoList(); Mapper.Initialize(cfg => cfg.CreateMap <FotoDTO, FotoViewModel>()); var fotos = Mapper.Map <IEnumerable <FotoDTO>, List <FotoViewModel> >(fotoDTOs); return(fotos); }