private List <string> LoadMetadata(MetadataType type)
        {
            var loadingOptions = new MetadataLoadingOptions
            {
                LoadDefaultDatabaseOnly = type != MetadataType.Database,
                LoadSystemObjects       = true
            };

            var container = new MetadataContainer(TemporaryMetadataContainer.SQLContext)
            {
                LoadingOptions = loadingOptions
            };

            var list = new MetadataList(container);

            list.Load(type, false);
            //list.Load(MetadataType.Database, false);

            //if (type == MetadataType.Schema)
            //{
            //    var defaultDb = list.Databases.FirstOrDefault(x => x.Default);
            //    if (defaultDb != null)
            //    {
            //        defaultDb.Items.Load(type, false);
            //        list = defaultDb.Items;
            //    }
            //}

            return(list.Select(x => x.Name).ToList());
        }
        private List <string> LoadMetadata(MetadataType type)
        {
            var loadingOptions = new MetadataLoadingOptions
            {
                LoadDefaultDatabaseOnly = type != MetadataType.Database,
                LoadSystemObjects       = true
            };

            var container = new MetadataContainer(TemporaryMetadataContainer.SQLContext)
            {
                LoadingOptions = loadingOptions
            };

            var list = new MetadataList(container);

            list.Load(type, false);
            return(list.Select(x => x.Name).ToList());
        }