private void AddQuestion() { if (QuestionToAdd == null) { return; } if (QuestionItems.Select(q => q.QuestionId).Contains(QuestionToAdd.Id)) { return; } var newQ = new QuestionItem { Question = QuestionToAdd.Question, QuestionList = QuestionList }; Context.QuestionItems.Add(newQ); Context.SaveChanges(); QuestionItems.Add(new QuestionItemViewModel(Context, newQ)); }
private void RemoveQuestion() { SelectedQuestionItem.Destroy(); QuestionItems.Remove(SelectedQuestionItem); }