Exemple #1
0
        public void SaveArchQuestionsForTest(List <Tuple <Question, int> > archiveList)
        {
            List <ArchQuestion> archQuestion = ArchiveConverter.AddArchiveQuestions(archiveList);

            foreach (ArchQuestion a in archQuestion)
            {
                if (!GetAllArchQuestions().Exists(q => q.RefQuestion == a.RefQuestion))
                {
                    CreateArchQuestion(a);
                }
                else
                {
                    ArchQuestion arch = GetAllArchQuestions().FirstOrDefault(q => q.RefQuestion == a.RefQuestion);
                    arch.Repeat = a.Repeat;
                    EditArchQuestion(arch);
                }
                SaveChanges();
            }
        }
Exemple #2
0
 public void DeleteArchQuestions(ArchQuestion question)
 {
     context.Set <ArchQuestion>().Remove(question);
 }
Exemple #3
0
 public void EditArchQuestion(ArchQuestion question)
 {
     context.Entry <ArchQuestion>(question).CurrentValues.SetValues(question);
 }
Exemple #4
0
 public void CreateArchQuestion(ArchQuestion question)
 {
     context.Set <ArchQuestion>().Add(question);
 }