Esempio n. 1
0
        /// <summary>
        /// Get every entry in this database that can be described in a single
        /// sql file.
        /// </summary>
        /// <returns>An enumerable iterating over the list of all
        /// entries.</returns>
        internal IEnumerable <BaseWritableObject> GetWritableEntries()
        {
            foreach (var tableOrView in TablesAndViews)
            {
                yield return(tableOrView);
            }

            foreach (var procedure in StoredProcedures)
            {
                yield return(procedure);
            }

            foreach (var schema in Schemas.Where(s => !s.IsDefaultSchema))
            {
                yield return(schema);
            }

            foreach (var tableType in TableTypes)
            {
                yield return(tableType);
            }

            foreach (var function in Functions)
            {
                yield return(function);
            }
        }
Esempio n. 2
0
        public List <DatabaseObjectBase> GetDatabaseObjects(bool filter)
        {
            var lst = (from s in Schemas
                       from rs in s.RoutinesSynonyms
                       select rs).OfType <DatabaseObjectBase>().ToList();

            lst.AddRange((from s in Schemas
                          from v in s.Views
                          select v).OfType <DatabaseObjectBase>());

            lst.AddRange(Principals.Where(p => !filter || !"|INFORMATION_SCHEMA|sys|guest|public|".Contains("|" + p.PrincipalName + "|")).ToList());
            lst.AddRange(Schemas.Where(s => !filter || !"|INFORMATION_SCHEMA|dbo|".Contains("|" + s.SchemaName + "|")).ToList());
            //lst.AddRange(Principals.Where(p => !"|INFORMATION_SCHEMA|sys|guest|public|dbo|".Contains("|" + p.PrincipalName + "|")).ToList());
            //lst.AddRange(Schemas.Where(s => !"|INFORMATION_SCHEMA|dbo|".Contains("|" + s.SchemaName + "|")).ToList());
            lst.AddRange(ServerLogins.Where(l => !filter || l.LoginType != LoginType.WindowsLogin).ToList());
            lst.AddRange(Permissions.ToList());
            lst.AddRange(Credentials.ToList());
            return(lst);
        }
Esempio n. 3
0
        public Result GetResult()
        {
            Schemas schems = GetSchemas();
            Tables  tables = new Tables();

            var oTables = schems.Select(p => new { p.表格名稱 }).GroupBy(p => p);

            foreach (var oTable in oTables)
            {
                tables.Add(new Table()
                {
                    表格名稱    = oTable.Key.表格名稱,
                    Schemas = schems.Where(p => p.表格名稱 == oTable.Key.表格名稱).ToList <Schema>()
                });
            }

            return(new Result()
            {
                Schems = schems,
                Tables = tables
            });
        }
 public IEnumerable <SCIMSchema> GetExtensionSchemas()
 {
     return(Schemas.Where(s => !s.IsRootSchema));
 }