private void SetMetaDataList(string tableName, string connectionString)
        {
            SprocDataLayerGeneratorDataAccess dataAccess            = new SprocDataLayerGeneratorDataAccess();
            MetaInformationSchema             metaInformationSchema = dataAccess.GetSchema(connectionString, tableName);

            _metaDataList.Add(metaInformationSchema);
        }
示例#2
0
        public List <MetaInformationSchema> GetMetaInformationSchemaFromLists(List.InformationSchemaTable tables,
                                                                              List.InformationSchemaTableConstraint tableConstraints,
                                                                              List.InformationSchemaColumn tableColumns,
                                                                              List.InformationSchemaConstraintColumnUsage constraintColumnUsage)
        {
            List <MetaInformationSchema> allSchemas         = new List <MetaInformationSchema>();
            PredicateFunctions           predicateFunctions = new PredicateFunctions();

            if (tables != null)
            {
                foreach (Data.InformationSchemaTable table in tables)
                {
                    MetaInformationSchema oneSchema = new MetaInformationSchema();
                    oneSchema.MetaTable = table;

                    predicateFunctions.TableNameHolder = table.TableName;

                    if (tableConstraints != null)
                    {
                        oneSchema.MetaTableConstraints.AddRange(tableConstraints.FindAll(predicateFunctions.FindTableConstraintByTableName));
                    }
                    if (tableColumns != null)
                    {
                        oneSchema.MetaColumns.AddRange(tableColumns.FindAll(predicateFunctions.FindTableColumnByTableName));
                    }
                    if (constraintColumnUsage != null)
                    {
                        oneSchema.MetaConstraintColumnUsage.AddRange(constraintColumnUsage.FindAll(predicateFunctions.FindConstraintColumnUsageByTableName));
                    }
                    allSchemas.Add(oneSchema);
                }
            }
            return(allSchemas);
        }
        public MetaInformationSchema GetSchemaByTableName(string tableName, List <MetaInformationSchema> schemas)
        {
            MetaInformationSchema schema             = null;
            PredicateFunctions    predicateFunctions = new PredicateFunctions();

            predicateFunctions.TableNameHolder = tableName;
            schema = schemas.Find(predicateFunctions.FindMetaInformationSchemaByTableName);
            return(schema);
        }