コード例 #1
0
        public async Task <IActionResult> Create(DiseaseSymptomInputViewModel diseaseSymptom)
        {
            await this.diseasesService.CreateDiseaseSymptomAsync(
                diseaseSymptom.DiseaseId,
                diseaseSymptom.SymptomId);

            this.TempData["CreateDiseaseSymptom"] = $"You have successfully created this relation!";

            return(this.RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <IActionResult> Create()
        {
            var diseasesInput = await this.diseasesService.
                                DiseasesDropDownMenuAsync <DiseasesDropDownViewModel>();

            var symptomsInput = this.symptomsServices
                                .SymptomsDropDownMenu <SymptomsDropDownViewModel>();

            var inputDiseaseSymptom = new DiseaseSymptomInputViewModel
            {
                diseases = diseasesInput,
                symptoms = symptomsInput,
            };

            return(this.View(inputDiseaseSymptom));
        }