Esempio n. 1
0
 public void Execute(IJobExecutionContext context)
 {
     try
     {
         Stopwatch sw = new Stopwatch();
         sw.Start();
         using (ServiceBoilerplateContext db = new ServiceBoilerplateContext())
         {
             ISync sync = (ISync)Activator.CreateInstance(typeof(TSync), db);
             sync.Cover();
             db.SaveChanges();
         }
         sw.Stop();
         logger.InfoFormat("{0} Cover {1}.", typeof(TSync).Name, sw.Elapsed);
     }
     catch (Exception e)
     {
         logger.Error("Execute failed.", e);
     }
 }