Пример #1
0
        /// <summary>
        /// Gets the model for the page
        /// </summary>
        /// <param name="currentPage">The current page</param>
        /// <returns>The page model</returns>
        public virtual ServerErrorViewModel GetError500Model(IPublishedContent currentPage)
        {
            var model = new ServerErrorViewModel
            {
                Metadata = _metadataHandler.GetMetadata(currentPage)
            };

            Mapper.Map(currentPage, model);

            return(model);
        }
Пример #2
0
        /// <summary>
        /// Gets the model for the page
        /// </summary>
        /// <typeparam name="T">The page type</typeparam>
        /// <param name="currentPage">The current page</param>
        /// <param name="currentMember">The current member</param>
        /// <returns>The page model</returns>
        public virtual T GetPageModel <T>(IPublishedContent currentPage, IMember currentMember) where T : BasePageViewModel, new()
        {
            var model = new T
            {
                Metadata         = _metadataHandler.GetMetadata(currentPage),
                MainNavigation   = _navigationHandler.GetMainNavigation(currentPage, currentMember),
                FooterNavigation = _navigationHandler.GetFooterNavigation(currentPage)
            };

            Mapper.Map(currentPage, model);

            return(model);
        }