Esempio n. 1
0
        public async Task <IActionResult> Index(
            int type       = 0,
            int pageNumber = 1,
            int pageSize   = -1,
            string sort    = "desc"
            )
        {
            var itemsPerPage = 10;

            if (pageSize > 0)
            {
                itemsPerPage = pageSize;
            }

            var model = await _appSettingService.GetPagedAppSettingAsync(
                pageNumber, itemsPerPage, sort == "desc"?SortOrder.Descending : SortOrder.Ascending, type).ConfigureAwait(false);

            model.Type = type;
            model.Paging.CurrentPage  = pageNumber;
            model.Paging.ItemsPerPage = itemsPerPage;
            return(View(model));
        }