Esempio n. 1
0
        public async Task <AlbumsListPagination> GetAlbumPaginated()
        {
            List <Album> albums = await GetAlbumListFromUrlAsync();

            AlbumsListPagination model = new AlbumsListPagination
            {
                Total         = albums.Count,
                Items_page    = 7,
                Current_page  = 1,
                Last_page     = Convert.ToInt32(Math.Round(Convert.ToDecimal(albums.Count / 7), 0)),
                Next_page_url = $"{_UrlSettings.Albums}?page=2",
                Prev_page_url = null,
                From          = 1,
                To            = 10,
                Data          = albums.ToArray()
            };

            return(model);
        }
Esempio n. 2
0
        public async Task <IActionResult> GetAlbumsTableAsync()
        {
            AlbumsListPagination albums = await _PhotoService.GetAlbumPaginated();

            return(Json(albums));
        }