public IActionResult UserPlaylists(int currentPage = 1) { var userId = int.Parse(userManager.GetUserId(HttpContext.User)); var playlistsDTO = service.GetPlaylistsPerPageOfCollection(currentPage, userId, "myPlaylists"); var totalPages = service.GetPageCountOfCollection(userId, "myPlaylists"); var playlistsViewModels = playlistsDTO.Select(x => new PlaylistViewModel(x)); PlaylistCollectionViewModel playlistList = new PlaylistCollectionViewModel() { Playlists = playlistsViewModels, TotalPages = totalPages, CurrentPage = currentPage }; return(View(playlistList)); }
public PlaylistPage() { _viewModel = new PlaylistCollectionViewModel(new PageService()); InitializeComponent(); }