Esempio n. 1
0
 public IDictionary <dac.TSqlObject, IEnumerable <ForeignKeyConstraintDefinition> > GetForeignKeys(IEnumerable <dac.TSqlObject> objects)
 {
     return(objects.Select(obj =>
     {
         TSqlFragment fragment;
         TSqlModelUtils.TryGetFragmentForAnalysis(obj, out fragment);
         var foreignKeyConstraintVisitor = new ForeignKeyConstraintVisitor();
         fragment.Accept(foreignKeyConstraintVisitor);
         return new { obj, foreignKeyConstraintVisitor.Nodes };
     }).ToDictionary(key => key.obj, val => val.Nodes.AsEnumerable()));
 }
Esempio n. 2
0
 public IDictionary<dac.TSqlObject, IEnumerable<ForeignKeyConstraintDefinition>> GetForeignKeys(IEnumerable<dac.TSqlObject> objects)
 {
     return objects.Select(obj =>
     {
         TSqlFragment fragment;
         TSqlModelUtils.TryGetFragmentForAnalysis(obj, out fragment);
         var foreignKeyConstraintVisitor = new ForeignKeyConstraintVisitor();
         fragment.Accept(foreignKeyConstraintVisitor);
         return new { obj, foreignKeyConstraintVisitor.Nodes };
     }).ToDictionary(key => key.obj, val => val.Nodes.AsEnumerable());
 }