コード例 #1
0
ファイル: CatalogAdapter.cs プロジェクト: jaenudin86/Meta.Net
 /// <summary>
 /// Fills all catalogs in the server object as well as building out the schemas
 /// and all objects in the database connection.
 /// </summary>
 /// <param name="server">The server to fill catalogs only.</param>
 /// <param name="connection">The open database connection to use.</param>
 /// <param name="metadataScriptFactory">The script factory determined by the database type.</param>
 public static void Build(
     Server server,
     DbConnection connection,
     IMetadataScriptFactory metadataScriptFactory)
 {
     Get(server, connection, metadataScriptFactory);
     foreach (var catalog in server.Catalogs)
     {
         SchemaAdapter.Build(catalog, connection, metadataScriptFactory);
     }
 }
コード例 #2
0
ファイル: CatalogAdapter.cs プロジェクト: jaenudin86/Meta.Net
 /// <summary>
 /// Fills only specific catalogs in the server object as well as building out the schemas
 /// and all objects in the database connection.
 /// </summary>
 /// <param name="server">The server to fill catalogs only.</param>
 /// <param name="connection">The open database connection to use.</param>
 /// <param name="metadataScriptFactory">The script factory determined by the database type.</param>
 /// <param name="catalogs">The catalogs to filter.</param>
 public static void BuildSpecific(
     Server server,
     DbConnection connection,
     IMetadataScriptFactory metadataScriptFactory,
     IList <string> catalogs)
 {
     GetSpecific(server, connection, metadataScriptFactory, catalogs);
     foreach (var catalog in server.Catalogs)
     {
         SchemaAdapter.Build(catalog, connection, metadataScriptFactory);
     }
 }
コード例 #3
0
ファイル: CatalogAdapter.cs プロジェクト: jaenudin86/Meta.Net
        /// <summary>
        /// Fills all catalogs in the server object as well as building out the schemas
        /// and all objects in the database connection.
        /// </summary>
        /// <param name="server">The server to fill catalogs only.</param>
        /// <param name="connection">The open database connection to use.</param>
        /// <param name="metadataScriptFactory">The script factory determined by the database type.</param>
        /// <param name="cancellationToken">The optional cancellation token.</param>
        public static async Task BuildAsync(
            Server server, DbConnection connection,
            IMetadataScriptFactory metadataScriptFactory,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            await GetAsync(server, connection, metadataScriptFactory, cancellationToken);

            foreach (var catalog in server.Catalogs)
            {
                await SchemaAdapter.BuildAsync(catalog, connection, metadataScriptFactory, cancellationToken);
            }
        }