public void Run() { for (int i = 0; i < threads.Length; i++) { var Paths = DivideFiles(i); Thread currentThread = new Thread(() => ProcessFiles(Paths)); threads[i] = currentThread; currentThread.Start(); } foreach (var thread in threads) { thread.Join(); } Console.WriteLine("Finished insertion. Working on DF"); //After documents are tokenized. Query the DB and fill the DB table. using (var connection = new SqlConnection()) { var client = new DBClient(connection); client.FillDF(); Console.WriteLine("Finished DF, starting on TFiDF"); client.CalculateTFiDF(Files.Count); } }
private void AddToDB(List <TokenModel> tokens) { using (var connection = new SqlConnection()) { var client = new DBClient(connection); client.BulkInsertTokens(tokens); } }