public async Task <INotFoundPageViewModel> BuildNotFoundPageViewModelAsync(NotFoundPageViewModelBuilderParameters mappingParameters)
        {
            // This example show using the default behaviour without any customization
            // You could alternatively inherit from PageViewModelBuilder and use the base implementation
            var viewModel = _pageViewModelFactory.CreateNotFoundPageViewModel();

            await _pageViewModelMapper.MapNotFoundPageViewModelAsync(viewModel, mappingParameters);

            return(viewModel);
        }
Example #2
0
        /// <summary>
        /// Creates and maps data to a view model for a 404 page.
        /// </summary>
        /// <param name="mappingParameters">The data passed through to map to the view model.</param>
        public virtual async Task <INotFoundPageViewModel> BuildNotFoundPageViewModelAsync(
            NotFoundPageViewModelBuilderParameters mappingParameters
            )
        {
            var viewModel = _pageViewModelFactory.CreateNotFoundPageViewModel();

            await _pageViewModelMapper.MapNotFoundPageViewModelAsync(viewModel, mappingParameters);

            return(viewModel);
        }