public async Task <IActionResult> Index(string learnAimRef)
        {
            var viewModel = new LearningAimsCategoryViewModel
            {
                LearningAimModel = await _learningAimsApiService.GetLearningAim(learnAimRef)
            };

            return(View(viewModel));
        }
コード例 #2
0
        private async Task <FrameworkViewModel> GetData(string learnAimRef)
        {
            var learningAim = await _learningAimsApiService.GetLearningAim(learnAimRef);

            return(new FrameworkViewModel
            {
                LearningAim = learningAim
            });
        }
        private async Task <LearningAimDetailsViewModel> GetData(string learnAimRef, string academicYear = null)
        {
            var lookupsTask     = _lookupApiService.GetLookups();
            var learningAimTask = _learningAimsApiService.GetLearningAim(learnAimRef);

            await Task.WhenAll(lookupsTask, learningAimTask);

            var lookups     = lookupsTask.Result;
            var learningAim = learningAimTask.Result;

            var selectedYear = academicYear ?? lookups.AcademicYearLookups.FirstOrDefault(l => l.IsCurrentAcademicYear)?.AcademicYear;

            return(new LearningAimDetailsViewModel
            {
                AcademicYear = selectedYear,
                LookUpModel = lookups,
                LearningAimModel = learningAim,
                FormController = FormController,
                CategoryController = CategoryController
            });
        }