/// <summary> /// Gets the customErrorPageItem internal. /// </summary> /// <param name="customErrorPageItemId">The customErrorPageItem id.</param> /// <returns></returns> private ItemContext <CustomErrorPageItemViewModel> GetCustomErrorPageItemInternal(string customErrorPageItemId) { var customErrorPageItemIdGuid = new Guid(customErrorPageItemId); var manager = CustomErrorPagesManager.GetManager(); var customErrorPageItem = manager.GetCustomErrorPageItem(customErrorPageItemIdGuid); var customErrorPageItemViewModel = new CustomErrorPageItemViewModel(); CustomErrorPageItemsViewModelTranslator.ToViewModel(customErrorPageItem, customErrorPageItemViewModel, manager); return(new ItemContext <CustomErrorPageItemViewModel>() { Item = customErrorPageItemViewModel }); }
/// <summary> /// Gets the customErrorPageItems internal. /// </summary> /// <param name="provider">The provider.</param> /// <param name="sortExpression">The sort expression.</param> /// <param name="skip">The skip.</param> /// <param name="take">The take.</param> /// <param name="filter">The filter.</param> /// <returns></returns> private CollectionContext <CustomErrorPageItemViewModel> GetCustomErrorPageItemsInternal(string provider, string sortExpression, int skip, int take, string filter) { var manager = CustomErrorPagesManager.GetManager(provider); var customErrorPageItems = manager.GetCustomErrorPageItems(); var totalCount = customErrorPageItems.Count(); if (!string.IsNullOrEmpty(sortExpression)) { customErrorPageItems = customErrorPageItems.OrderBy(sortExpression); } if (!string.IsNullOrEmpty(filter)) { customErrorPageItems = customErrorPageItems.Where(filter); } if (skip > 0) { customErrorPageItems = customErrorPageItems.Skip(skip); } if (take > 0) { customErrorPageItems = customErrorPageItems.Take(take); } var customErrorPageItemsList = new List <CustomErrorPageItemViewModel>(); foreach (var customErrorPageItem in customErrorPageItems) { var customErrorPageItemViewModel = new CustomErrorPageItemViewModel(); CustomErrorPageItemsViewModelTranslator.ToViewModel(customErrorPageItem, customErrorPageItemViewModel, manager); customErrorPageItemsList.Add(customErrorPageItemViewModel); } return(new CollectionContext <CustomErrorPageItemViewModel>(customErrorPageItemsList) { TotalCount = totalCount }); }