public CSVParser(string path, QuestionAndAnswerRepository questionAndAnswerRepository,
                  WordAndAnswerRepository wordAndAnswerRepository)
 {
     this.questionAndAnswerRepository = questionAndAnswerRepository;
     this.wordAndAnswerRepository     = wordAndAnswerRepository;
     this.path = path;
 }
 public VkEventHandler(IVkApi vkApi,
                       WordAndAnswerRepository wordAndAnswerRepository,
                       QuestionAndAnswerRepository questionAndAnswerRepository)
 {
     this.vkApi = vkApi;
     this.wordAndAnswerRepository     = wordAndAnswerRepository;
     this.questionAndAnswerRepository = questionAndAnswerRepository;
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var connectionString = "Server=localhost;Port=3306;User=u1090_113default;Password=E51wd#2i;Database=u1090113_default;";

            var db     = new MySqlDataBase(connectionString);
            var parser = new CSVParser("csvData.csv",
                                       new QuestionAndAnswerRepository(db), new WordAndAnswerRepository(db));
            // parser.Parse();
            var qr      = new QuestionAndAnswerRepository(db);
            var answers = new WordAndAnswerRepository(db).FindSeveralByPhrase("что курсовая когда зачем баллы");

            foreach (var answer in qr.FindSeveralByAnswers(answers))
            {
                Console.WriteLine(answer.Question);
            }
        }