public async Task <ErrorTestDto> ReadSingleTestQuestions(int id, UploadFile uploadFile)
        {
            ErrorTestDto errorTestDto      = new ErrorTestDto();
            var          files             = uploadFile.formFile;
            var          list_testQuestion = new List <TestQuestions>();
            var          list_answer       = new List <Answers>();
            var          options           = new List <string>();
            var          test = await testRepository.GetTest(id);

            CultureInfo culture1 = CultureInfo.CurrentCulture;

            using (TextReader reader = new StreamReader(files.OpenReadStream(), Encoding.UTF8))
                using (var csv = new CsvReader(reader, culture1))
                {
                    foreach (var i in csv.GetRecords <ReadSingleTestDto>())
                    {
                        if (i.Question == "" || i.OptionA == "" ||
                            i.OptionB == "" || i.OptionC == "" ||
                            i.Answer == "" || i.Complexity == "")
                        {
                            errorTestDto.FieldEmpty = 400;
                            return(errorTestDto);
                        }
                        if (Int32.Parse(i.Complexity) < 1 && Int32.Parse(i.Complexity) > 3)
                        {
                            errorTestDto.FieldEmpty = 400;
                            return(errorTestDto);
                        }
                        if (test.AutomaticTime == true)
                        {
                            var testTime = 0;
                            if (i.Complexity == "1")
                            {
                                testTime += 1;
                            }
                            else if (i.Complexity == "2")
                            {
                                testTime += 3;
                            }
                            else if (i.Complexity == "3")
                            {
                                testTime += 5;
                            }
                            test.TimeOfTest += testTime;
                            testRepository.Update(test);
                            await testRepository.SaveChangesAsync();
                        }
                        var testQuestion = new TestQuestions(test.Id, test.SubjectId, i.Question, Int32.Parse(i.Complexity));
                        ///
                        list_testQuestion.Add(testQuestion);
                        options.Add(i.OptionA);
                        options.Add(i.OptionB);
                        options.Add(i.OptionC);
                        foreach (var answers in options)
                        {
                            if (answers == i.Answer)
                            {
                                var answer = new Answers(test.SubjectId, test.Id, testQuestion.NumberOfIdentification, answers, true);
                                list_answer.Add(answer);
                            }
                            else
                            {
                                var answer = new Answers(test.SubjectId, test.Id, testQuestion.NumberOfIdentification, answers, false);
                                list_answer.Add(answer);
                            }
                        }
                        options = new List <string>();
                    }
                    if (list_testQuestion.Count == 0)
                    {
                        errorTestDto.FieldEmpty = 400;
                        return(errorTestDto);
                    }
                    testQuestionRepository.AddTestsQuestions(list_testQuestion);
                    answersRepository.SaveAnswers(list_answer);

                    return(errorTestDto);
                }
        }