Пример #1
0
        public void SaveHistory(string hangfireId, string message, DateTime startDate)
        {
            HangfireHistory history = HangfireHistory.Create(hangfireId, message, startDate);

            HangfireHistories.Add(history);
            SaveChanges();
        }
Пример #2
0
        public static HangfireHistory Create(string hangfireId, string message, DateTime startDate)
        {
            DateTime        today  = DateTime.Now;
            HangfireHistory result = new HangfireHistory
            {
                Duration   = (int)(today - startDate).TotalSeconds,
                HangfireId = hangfireId,
                Message    = message,
                StartTime  = startDate
            };

            return(result);
        }