Beispiel #1
0
        public static void Main(string[] args)
        {
            var configurator = new ArBatchJobConfig();
            var job          = configurator.GetXmlJob();
            var jobExecution = JobStarter.Start(job, new ArBatchUnityLoader());

            /*
             */

            Database.SetInitializer(new DropCreateDatabaseIfModelChanges <DbStuffzContext>());

            var con = ConfigurationManager.ConnectionStrings["Default"].ConnectionString;

            Console.WriteLine("connection string");
            Console.WriteLine(con);

            /*
             * using (var db = )
             * {
             *  var in1 = new InModel {Name = "joe"};
             *
             *  db.Ins.Add(in1);
             *  db.SaveChanges();
             * }
             */
        }
Beispiel #2
0
        /// <summary>
        /// Launches the job
        /// </summary>
        /// <param name="args">The arguments for the job execution</param>
        /// <returns></returns>
        public static int Main(string[] args)
        {
#if DEBUG
            var stopwatch = new Stopwatch();
            stopwatch.Start();
#endif
            JobExecution jobExecution = JobStarter.Start(@"Batch\MyFirstBatch.xml", new MyFirstBatchUnityLoader());
#if DEBUG
            stopwatch.Stop();
            Console.WriteLine(Environment.NewLine + "Done in {0}ms.",
                              stopwatch.ElapsedMilliseconds);
            Console.WriteLine("Press a key to end.");
            Console.ReadKey();
#endif
            return((int)(jobExecution.Status == BatchStatus.Completed ? JobStarter.Result.Success : JobStarter.Result.Failed));
        }