示例#1
0
        public ActionResult Up(int?id)
        {
            string resultText;
            var    version = _migrationInformation.CurrentVersion().Version;

            if (version == id)
            {
                resultText = "Already on this version.";
            }
            else if (id.HasValue && version > id)
            {
                resultText = "On a newer version.";
            }
            else
            {
                _migrator.MigrateUp(id);
                resultText = "Migrated!";
            }

            return(new ContentResult {
                Content = resultText
            });
        }