private static void Log(ScheduleJob scheduleJob, DateTime startDate, DateTime endDate, string info, ScheduleTaskState state) { ScheduleExecutionInfo log = new ScheduleExecutionInfo() { StartDate = startDate, EndDate = endDate, ScheduleJobId = scheduleJob.Id, Info = info, State = (byte)state }; DataService.PerThread.ScheduleExecutionInfoSet.AddObject(log); DataService.PerThread.SaveChanges(); }