BVNetwork.NotFound.Controllers.NotFoundRedirectController.GetRedirectIndexViewData C# (CSharp) Method

GetRedirectIndexViewData() public method

Get the data that will be presented in the view(s).
public GetRedirectIndexViewData ( int pageNumber, List redirectList, string actionInformation, string searchWord, int pageSize, bool isSuggestions, bool showRedirects ) : BVNetwork.NotFound.Models.RedirectIndexViewData
pageNumber int The current page number for the pager view
redirectList List The List of redirects
actionInformation string Text that will be presented in the view
searchWord string
pageSize int
isSuggestions bool
showRedirects bool
return BVNetwork.NotFound.Models.RedirectIndexViewData
        public RedirectIndexViewData GetRedirectIndexViewData(int? pageNumber, List<CustomRedirect> redirectList, string actionInformation, string searchWord, int? pageSize, bool isSuggestions, bool? showRedirects)
        {
            RedirectIndexViewData indexData = new RedirectIndexViewData();
            indexData.IsSuggestions = isSuggestions;
            indexData.ActionInformation = actionInformation;
            indexData.ShowRedirects = showRedirects.HasValue ? showRedirects.Value : false;
            indexData.SearchWord = searchWord;
            indexData.TotalItemsCount = redirectList.Count;
            indexData.PageNumber = pageNumber ?? 1;
            //TODO: read pagersize and pagesize from configuration.
            indexData.PagerSize = 4;
            indexData.PageSize = pageSize ?? 30;
            if (redirectList.Count > indexData.PageSize)
                indexData.CustomRedirectList = redirectList.GetRange(indexData.MinIndexOfItem - 1, indexData.MaxIndexOfItem - indexData.MinIndexOfItem + 1);
            else
                indexData.CustomRedirectList = redirectList;
            return indexData;
        }