public void Create(DalQuestion e) { Question question = new Question() { Text = e.Text, Options = new List<Option>() }; foreach (DalOption dalOption in e.Options) { Option option = new Option() { Question = question, IsAnswer = dalOption.IsAnswer, Text = dalOption.Text }; question.Options.Add(option); } context.Set<Question>().Add(question); context.SaveChanges(); }
public void UpdateQuestion(Question question) { _questionRepository.Update(question); _uow.Commit(); }