Пример #1
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);
        }
        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);
        }
Пример #3
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 Task <INotFoundPageViewModel> BuildNotFoundPageViewModelAsync(
            NotFoundPageViewModelBuilderParameters mappingParameters
            )
        {
            var viewModel = _pageViewModelFactory.CreateNotFoundPageViewModel();

            _pageViewModelMapper.MapNotFoundPageViewModel(viewModel, mappingParameters);

            return(Task.FromResult(viewModel));
        }