public void Execute(IJobExecutionContext context) { _iAppointmentBus = (IAppointmentBus)GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(IAppointmentBus)); _iAppointmentBus.SendEmailForAppointmentsComingInTwoDays(); }