public XExamVM(XExam exam) { _exam = exam; _paramsObsCollection = new ObservableCollection<XParamVM>(); foreach (var v in this.Exam.ParamsCollection) _paramsObsCollection.Add(new XParamVM(v)); _paramCVS = new CollectionViewSource(); _paramCVS.Source = _paramsObsCollection; _examType = new XExamTypeVM(Exam.ExamType); }
internal void RemoveExam(XExam examToRemove) { DbContext.Parameters.RemoveRange(examToRemove.ParamsCollection); DbContext.Exams.Remove(examToRemove); }