void Worker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         var documentMigrator = new CosmosCloneCommon.Migrator.DocumentMigrator();
         documentMigrator.StartCopy(scrubRules).Wait();
     }
     catch (Exception ex)
     {
         logger.LogInfo("Main process exits with error");
         logger.LogError(ex);
         string excmessage = "Main process exits with error. /n" + ex.Message + "/n";
         if (ex.InnerException != null)
         {
             excmessage += ex.InnerException.Message;
         }
         MessageBox.Show(excmessage, "Error occurred. App closure", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Beispiel #2
0
        public static void TestCosmosScrubbing()
        {
            var tcs = new DataScrubMigrator();
            // ScrubRule rule1 = new ScrubRule("c.id=\"a5e66b8b-a57c-4788-a194-58d3735a9854\"", "c.CompositeName",  RuleType.Singlevalue, "Test overwritten Value xyz",1);
            //ScrubRule rule2 = new ScrubRule("", "c.SuperKeys.KeyValue",  RuleType.Shuffle, "",2);
            //ScrubRule rule3 = new ScrubRule("", "c.EntityValue.Name", RuleType.Shuffle, "", 3);
            //ScrubRule rule4 = new ScrubRule("", "c.EntityValue.Description", RuleType.Singlevalue, "OverWrite Filtered rule Description", 4);
            //ScrubRule rule3 = new ScrubRule("c.id=\"1402e84d-e034-45f9-8064-3ab174119e4f\"", "c.EntityValue.Name", RuleType.Singlevalue,"Test overwritten EntityName", 3);
            var scrubRules = new List <ScrubRule>();
            //scrubRules.Add(rule2);
            //scrubRules.Add(rule3);
            //scrubRules.Add(rule4);
            //ScrubRule rule5 = new ScrubRule("c.EntityType=\"External\"", "c.EmailAddress", RuleType.Singlevalue, "*****@*****.**", 4);
            ScrubRule rule6 = new ScrubRule("c.id=\"2826d281-3a8b-4408-b064-efff26e26119\"", "c.EmailAddress", RuleType.SingleValue, "*****@*****.**", 4);

            scrubRules.Add(rule6);
            var documentMigrator = new CosmosCloneCommon.Migrator.DocumentMigrator();

            documentMigrator.StartCopy(scrubRules).Wait();
            //var result = tcs.StartScrub(scrubRules);
        }