DBUpdater.UpgradeScripts.Add C# (CSharp) Method

Add() public method

public Add ( UpgradeScript script ) : void
script UpgradeScript
return void
        public void Add(UpgradeScript script)
        {
            _upgradeScripts.Add(script);
        }

Usage Example

示例#1
0
        public bool CreateUpgradePath()
        {
            _upgradePath = new UpgradeScripts();

             int from = _application.Database.CurrentVersion;
             int to = _application.Database.RequiredVersion;

             // Actually create the path.
             while (from != to)
             {
            UpgradeScript script = _upgradeScripts.GetScriptUpgradingFrom(from);

            if (script == null)
            {
               MessageBox.Show("Upgrade path not found. Please contact support", "hMailServer");
               return false;
            }

            string fileName = GetScriptFileName(script);

            if (!File.Exists(fileName))
            {
               MessageBox.Show("Required file for upgrade not found:" + Environment.NewLine + fileName, "hMailServer");
               return false;
            }

            _upgradePath.Add(script);

            from = script.To;
             }

             DisplayUpgradePath();

             return true;
        }
All Usage Examples Of DBUpdater.UpgradeScripts::Add