Create() public static method

public static Create ( string contextKey, string deployerVersion, string targetAssemblyPath, DbConnection connection, string schemaName ) : void
contextKey string
deployerVersion string
targetAssemblyPath string
connection System.Data.Common.DbConnection
schemaName string
return void
示例#1
0
        private void HandleDeploymentHistory(string schemaName, string contextKey)
        {
            var factory = DbProviderFactories.GetFactory(m_ConnectionInfoBuilder.ProviderName);

            using (var connection = factory.CreateConnection())
            {
                connection.ConnectionString = m_ConnectionInfoBuilder.BuildConnectionString(
                    m_Config.Database,
                    m_Config.AuthMode,
                    m_Config.SqlLogin,
                    m_Config.SqlPassword);

                connection.Open();

                Log.Information(
                    "Creating {contextKey} deployment history in {schemaName} schema " +
                    "on {endPointServer}\\{endpointDatabase} using {targetAssemblyPath}.",
                    contextKey,
                    schemaName,
                    m_Config.Database.ServerName,
                    m_Config.Database.DatabaseName,
                    m_Config.TargetAssemblyPath);

                DeploymentHistory.Create(
                    contextKey,
                    GetVersion().ToString(),
                    m_Config.TargetAssemblyPath,
                    connection,
                    schemaName);

                connection.Close();
            }
        }