Beispiel #1
0
 public IActionResult OnGet(int?id)
 {
     Symptoms = symptomService.GetSymptoms();
     if (id.HasValue)
     {
         Virus = virusService.GetVirusById(id.Value);
         if (Virus == null)
         {
             return(RedirectToPage("./List"));
         }
         foreach (var item in Symptoms)
         {
             foreach (var sv in Virus.VirusSymptoms)
             {
                 if (item.Id == sv.SymptomId)
                 {
                     item.IsSelected = true;
                 }
             }
         }
     }
     else
     {
         Virus = new Virus();
     }
     return(Page());
 }