How to get data into execute method in quartz.net scheduler
<p>I'm using the quartz.net scheduler to schedule my tasks in c# mvc code.</p>

<p>I want to start one method on application start that fetches data from the database and add it to the scheduler to run at a specific time.</p>

<p>My simple example scheduler is working fine when I use it to write a "hello" word. But when I write a method to get data from the database into an execute method I'm unable to create a parameterized constructor for that service and interface. </p>

<p>How can I do it please?
My code is:</p>

<pre><code>        // GET: /Schedule/
        public ActionResult Index()
        {
             // construct a scheduler factory
            ISchedulerFactory schedFact = new StdSchedulerFactory();

            // get a scheduler, start the schedular before triggers or anything else
            IScheduler sched = schedFact.GetScheduler();
            sched.Start();

            // create job
            IJobDetail job = JobBuilder.Create&lt;SimpleJob&gt;()
                    .WithIdentity("job1", "group1")
                    .Build();

            // create trigger
            ITrigger trigger = TriggerBuilder.Create()
                .WithIdentity("trigger1", "group1")
                .WithSimpleSchedule(x =&gt; x.WithIntervalInSeconds(2).RepeatForever())
                .Build();


            // Schedule the job using the job and trigger 
            sched.ScheduleJob(job, trigger);
            //    _QueuedMessagesSendTask.SendEmail();

            return View();
        }

    }
    /// &lt;summary&gt;
    /// SimpleJOb is just a class that implements IJOB interface. It implements just one method, Execute method
    /// &lt;/summary&gt;
    public class SimpleJob : IJob
    {
        private readonly XITDataContext _xitDataContext;

        public SimpleJob(XITDataContext xitDataContext)
        {
            this._xitDataContext = xitDataContext;
        }

        void IJob.Execute(IJobExecutionContext context)
        {
            var data = _xitDataContext.Invoice.ToList();
        }
    } 
</code></pre>