Exemplo n.º 1
0
        public void RefreshRulesFromRepository()
        {
            IEnumerable <SqlRewriteRule> items;

            lock (this)
            {
                items = _repository.LoadSqlRewriteRules();
            }
            SqlCommandRegExProcessor.SqlRewriteRules = items;
        }
Exemplo n.º 2
0
        private static void PrintCurrentRuleSet(ISqlRewriteRepository repo)
        {
            var currentRules = repo.LoadSqlRewriteRules();

            Console.WriteLine("Current rule set in database:\r\n");
            foreach (var loadedRule in currentRules)
            {
                Console.WriteLine($"RuleID                  : {loadedRule.Id}");
                Console.WriteLine($"Database RegEx          : {loadedRule.DatabaseRegEx}");
                Console.WriteLine($"Query match RegEx       : {loadedRule.QueryMatchRegEx}");
                Console.WriteLine($"Query replacement RegEx : {loadedRule.QueryReplacementString}");
                Console.WriteLine($"RegExOptions RegEx      : {loadedRule.RegExOptions}\r\n");
            }
        }