示例#1
0
		public ExitCode Run(string[] args)
		{
			try
			{
				var options = new Options();
				options.ParseArguments(args);

				var task = new Migrator();
				task.Run(new Configuration(options));
			}
			catch (Exception err)
			{
				Console.Error.WriteLine(err.ToString());
				return ExitCode.Failure;
			}

			return ExitCode.Success;
		}
		protected override void ExecuteTask()
		{
			var logAppender = new ConsoleAppender(); // new EventLogAppender();
			logAppender.Layout = new log4net.Layout.PatternLayout("%-6level %-13date{HH:mm:ss,fff} %m %newline");
			log4net.Config.BasicConfigurator.Configure(logAppender);

			DetectDataBase.Detect(this, this.DataBase);

			var migrator = new Migrator();
			migrator.Run(this);			
		}