Esempio n. 1
0
 private DbOptions(
     DatabaseInfo dbInfo,
     DbOptionCommands dbCommand,
     string exportFileName,
     string upgradePath)
 {
     DatabaseInfo         = dbInfo;
     Command              = dbCommand;
     ExportScriptFileName = exportFileName;
     UpgradeScriptsPath   = upgradePath;
     if (dbInfo != null)
     {
         ConnectionString = new DatabaseProviderFactory().Create(dbInfo.DbProvider).BuildConnectionString(dbInfo);
     }
 }
Esempio n. 2
0
        private string ToString(DbOptionCommands command)
        {
            var sb = new StringBuilder();

            if ((command & DbOptionCommands.Drop) == DbOptionCommands.Drop)
            {
                sb.AppendLine("  Drop database");
            }
            if ((command & DbOptionCommands.Create) == DbOptionCommands.Create)
            {
                sb.AppendLine("  Create database");
            }
            if ((command & DbOptionCommands.ExportSchema) == DbOptionCommands.ExportSchema)
            {
                sb.AppendLine("  Export database schema");
            }
            if ((command & DbOptionCommands.Upgrade) == DbOptionCommands.Upgrade)
            {
                sb.AppendLine("  Upgrade database");
            }
            return(sb.ToString());
        }