public static void CopyData() { var remote = new MatchingRequestRepository(); var pages = remote.GetAll(); int i = 0; foreach (var page in pages) { BulkInsertHelper.BulkSave(page, "Server=localhost;Database=TestDB;Trusted_Connection=True;", "[dbo].[MatchingRequest]"); Console.WriteLine(i++); } }
public static void Pump(int maxCount = 0) { var transferedRecords = 0; var reader = new MatchingRequestRepository(); var pages = reader.GetAll(); var client = GetClient(); foreach (var page in pages) { transferedRecords += WriteSubjects(page, client, 1, "matchingindex", "individual"); transferedRecords += WriteSubjects(page, client, 2, "matchingindex", "company"); if (maxCount > 0 && transferedRecords > maxCount) { continue; } } Console.WriteLine("Pump finished"); }