/// <summary> /// The add treatment. /// </summary> /// <param name="treatmentName"> /// The treatment name. /// </param> private void AddTreatment(string treatmentName) { using (var api = new BusinessContext()) { var treatment = new TreatmentModel { TreatmentName = treatmentName }; try { api.AddNewTreatment(treatment); } catch (Exception) { Console.WriteLine("api.addNew failed"); } this.Success = "Treatment " + this.TreatmentName + " added"; this.TreatmentTypes.Add(treatment); } }