PhotoSharingApp.AppService.Controllers.CategoryController.GetAsync C# (CSharp) Method

GetAsync() private method

private GetAsync ( [ numberOfThumbnails ) : Task>
numberOfThumbnails [
return Task>
        public async Task<IList<CategoryPreviewContract>> GetAsync([FromUri] int numberOfThumbnails)
        {
            try
            {
                _telemetryClient.TrackEvent("CategoryController GetAsync(numberOfThumbnails) invoked");
                var categoriesPreviewList = await _repository.GetCategoriesPreview(numberOfThumbnails);

                // Order by categories with the latest photo added.
                IList<CategoryPreviewContract> orderedCategoriesPreviewList =
                    categoriesPreviewList.OrderByDescending(x => x.PhotoThumbnails[0].CreatedAt).ToList();
                return orderedCategoriesPreviewList;
            }
            catch (DataLayerException ex)
            {
                _telemetryClient.TrackException(ex);

                if (ex.Error == DataLayerError.Unknown)
                {
                    throw ServiceExceptions.UnknownInternalFailureException(ServiceExceptions.Source);
                }

                throw ServiceExceptions.DataLayerException(ex.Message);
            }
        }

Same methods

CategoryController::GetAsync ( ) : Task>
CategoryController::GetAsync ( string id, [ continuationToken ) : Task>