public override DBCrontabEvent Tick() { var crontabEvent = base.Tick(); crontabEvent.LastRanTime = CrontabEntry.LastRunTime; CrontabEntry.LastRunTime = DateTime.Now; var crontabEntryRepository = new DBCrontabEntryRepository(); crontabEntryRepository.SaveOrUpdate(CrontabEntry); return(crontabEvent); }
protected override void InitTick() { var crontabEntryRepository = new DBCrontabEntryRepository(); CrontabEntry = crontabEntryRepository.LoadCrontabByKey(Key); if (CrontabEntry == null) { CrontabEntry = new DBCrontabEntry(Key); crontabEntryRepository.SaveOrUpdate(CrontabEntry); } base.InitTick(); }