Esempio n. 1
0
        public IActionResult Add(AddSymptomViewModel addSymptomViewModel)
        {
            // Add the new symptom to my existing symptoms
            Symptom newSymptom = new Symptom
            {
                Name     = addSymptomViewModel.Name,
                Date     = addSymptomViewModel.Date,
                Location = addSymptomViewModel.Location,
                Severity = addSymptomViewModel.Severity,
            };

            context.Symptoms.Add(newSymptom);
            context.SaveChanges();

            return(Redirect("/Symptom/List"));
        }
Esempio n. 2
0
        public IActionResult Add()
        {
            AddSymptomViewModel addSymptomViewModel = new AddSymptomViewModel();

            return(View(addSymptomViewModel));
        }