public IEnumerable <ServiceViewModel> GetAllServices() { IEnumerable <ServiceDTO> phoneDtos = studioService.GetAllServices(); var mapper = new MapperConfiguration(cfg => cfg.CreateMap <ServiceDTO, ServiceViewModel>()).CreateMapper(); var services = mapper.Map <IEnumerable <ServiceDTO>, List <ServiceViewModel> >(phoneDtos); return(services); }