/// <summary> /// Creates and maps data to a view model for a custom entity details page. /// </summary> /// <typeparam name="TDisplayModel">The type of display model to apply to the generic view model.</typeparam> /// <param name="mappingParameters">The data passed through to map to the view model.</param> public virtual async Task <ICustomEntityPageViewModel <TDisplayModel> > BuildCustomEntityPageViewModelAsync <TDisplayModel>( CustomEntityPageViewModelBuilderParameters mappingParameters ) where TDisplayModel : ICustomEntityPageDisplayModel { var viewModel = _pageViewModelFactory.CreateCustomEntityPageViewModel <TDisplayModel>(); await _pageViewModelMapper.MapCustomEntityViewModelAsync(viewModel, mappingParameters); return(viewModel); }
public async Task <ICustomEntityPageViewModel <TDisplayModel> > BuildCustomEntityPageViewModelAsync <TDisplayModel>( CustomEntityPageViewModelBuilderParameters mappingParameters ) where TDisplayModel : ICustomEntityPageDisplayModel { // Create the custom view model instance var viewModel = new ExampleCustomEntityPageViewModel <TDisplayModel>(); // Do the base mapping await _pageViewModelMapper.MapCustomEntityViewModelAsync(viewModel, mappingParameters); // Example of calling an async custom mapping function await ExampleCustomMappingAsync(viewModel); return(viewModel); }