Example #1
0
 private static string GetReferencedName(TSqlObject sqlObj, ModelRelationshipClass relation = null, string typeToLookFor = "Table")
 {
     if (relation == null)
     {
         return(sqlObj.GetReferenced().FirstOrDefault(o => _comparer.Equals(o.ObjectType.Name, typeToLookFor)).Name.Parts.LastOrDefault());
     }
     {
         return(sqlObj.GetReferenced(relation).FirstOrDefault(o => _comparer.Equals(o.ObjectType.Name, typeToLookFor)).Name.Parts.LastOrDefault());
     }
 }
Example #2
0
        public static void ProcessTSqlObjectIntoDimensionScriptFiles(ParsedArgs parsedArgs, TSqlObject table, ModelRelationshipClass relationshipTypeColumns, ModelRelationshipClass relationshipTypeSchema)
        {
            string        stagingSchemaName   = GetSchemaName(table);
            string        templateDimCoreName = GetObjectName(table).Replace("_dimSrc_stg", "");
            List <String> listOfColumns       = new List <String>();

            foreach (var col in table.GetReferenced(relationshipTypeColumns, DacQueryScopes.UserDefined))
            {
                String column = GetColumnName(col);
                listOfColumns.Add(column);
            }
            GenerateDimension(listOfColumns, templateDimCoreName, parsedArgs, stagingSchemaName);
        }
 public IEnumerable <ModelRelationshipInstance> GetReferencingRelationshipInstances(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes)
 {
     return(Element.GetReferencingRelationshipInstances(relationshipType, queryScopes));
 }
 public IEnumerable <ModelRelationshipInstance> GetReferencingRelationshipInstances(ModelRelationshipClass relationshipType)
 {
     return(Element.GetReferencingRelationshipInstances(relationshipType));
 }
 public IEnumerable <TSqlObject> GetReferencing(ModelRelationshipClass relationshipType, DacQueryScopes queryScopes)
 {
     return(Element.GetReferencing(relationshipType, queryScopes));
 }
 public IEnumerable <TSqlObject> GetReferencing(ModelRelationshipClass relationshipType)
 {
     return(Element.GetReferencing(relationshipType));
 }