public async Task <UserProfileViewModel> GetPrivateUserDefaultModel (ISpotifyClient client) { var userProfileRes = _userRepo.GetAllInformation(client); var userTopTracksRes = _userRepo.GetUserTopTracks(client); var userTopArtistsRes = _userRepo.GetUserTopArtists(client); var userPlayListsRes = _userRepo.GetUserPlayLists(client); var availableDevices = _playerRepo.GetAvailableDevices(client); var currentlyPlaying = _playerRepo.GetCurrentlyPlayingItem(client, new PlayerCurrentlyPlayingRequest(AdditionalTypes.Track)); await Task.WhenAll(userProfileRes, userTopTracksRes, userTopArtistsRes, userPlayListsRes, availableDevices, currentlyPlaying); var userModel = _mapper.Map <SpotifyUserProfile>(userProfileRes.Result); var listofTracks = _mapper.Map <List <FullTrackModel> >(userTopTracksRes.Result); var listofArtists = _mapper.Map <List <FullArtistModel> >(userTopArtistsRes.Result); var listOfPlayLists = _mapper.Map <List <SimplePlayListModel> >(userPlayListsRes.Result); var listOfDevices = _mapper.Map <DeviceResponseModel>(availableDevices.Result); if (currentlyPlaying.Result != null) { if (currentlyPlaying.Result.Item != null) { if (currentlyPlaying.Result.Item.Type == ItemType.Track) { var currentPlayingItem = _mapper.Map <CurrentlyPlayingModel>(currentlyPlaying.Result); if (currentPlayingItem != null) { _model.CurrentlyPlaying = currentPlayingItem; _model.CurrentlyPlaying.Item = _mapper.Map <FullTrackModel>(currentlyPlaying.Result.Item); } } } } _model.UserProfile = userModel; _model.UserTopTracks = listofTracks; _model.UserTopArtists = listofArtists; _model.UserPlayLists = listOfPlayLists; _model.CurrentDevices = listOfDevices; return(_model); }