Example #1
0
 public static RuleMatcher <T> Create(string pattern)
 {
     if (MatchingHelper.IsMatchAll(pattern))
     {
         return(new AllMatcher());
     }
     if (MatchingHelper.ContainsWildcardSymbols(pattern))
     {
         return(new PatternMatcher(pattern));
     }
     return(new NameMatcher(pattern));
 }
        private void VisitSchema(Schema schema, IgnoreRule rule)
        {
            foreignKeysOfSchema = schema.Tables.SelectMany(t => t.TableConstraints.OfType <ForeignKey>()).ToList();
            var matcher = RuleMatcher <Table> .Create(rule.Table);

            var matchedTables = matcher.Get(schema.Tables);

            if (!MatchingHelper.IsMatchAll(rule.Column))
            {
                foreach (var table in matchedTables)
                {
                    VisitTable(table, rule);
                }
            }
            else
            {
                foreach (var table in matchedTables)
                {
                    RemoveTable(schema.Tables, table);
                }
            }
        }