コード例 #1
0
        public async Task <FilterViewModel> CreateAsync(FilterSelectedOptionsViewModel input)
        {
            var selectionData = new FilterSelectionDataViewModel
            {
                SortOptions       = SetupSortOptions(input.SortOption),
                Agencies          = await SetupAgencies(input.Agencies),
                Categories        = await SetupCategories(input.Categories),
                DestinationPoints = await SetupDestinationPoints(input.DestinationPointId)
            };

            var filterViewModel = new FilterViewModel
            {
                Source   = selectionData,
                Selected = input
            };

            return(filterViewModel);
        }
コード例 #2
0
        public async Task <FilterViewModel> CreateAsync(FilterSelectedOptionsViewModel model)
        {
            var selectionDataViewModel = new FilterSelectionDataViewModel
            {
                Genres          = await SetupGenresAsync(model.Genres),
                Platforms       = await SetupPlatformsAsync(model.Platforms),
                Publishers      = await SetupPublishersAsync(model.Publishers),
                SortOptions     = SetupSortOptions(model.SortOption),
                PublishingDates = SetupCreationDate(model.CreationDate),
                PageSizes       = SetupPageSizes(model.PageSize),
            };
            var viewModel = new FilterViewModel
            {
                FilterSelectionDataViewModel   = selectionDataViewModel,
                FilterSelectedOptionsViewModel = model
            };

            return(viewModel);
        }