Exemplo n.º 1
0
 public Alert CreateAlert(long jobId, long?jobHistoryId, string message)
 {
     using (Linq2SqlJobStoreDalDataContext context = new Linq2SqlJobStoreDalDataContext(connectionString))
     {
         try
         {
             BackgroundWorkerAlert alert = new BackgroundWorkerAlert {
                 JobId = jobId, JobHistoryId = jobHistoryId, Message = message
             };
             context.BackgroundWorkerAlerts.InsertOnSubmit(alert);
             context.SubmitChanges();
             return(new Alert
             {
                 Id = alert.Id,
                 JobId = alert.JobId,
                 JobHistoryId = alert.JobHistoryId,
                 Message = alert.Message,
             });
         }
         catch (Exception ex)
         {
             logger.Error("CreateAlert failed.", ex);
         }
     }
     return(null);
 }
 partial void UpdateBackgroundWorkerAlert(BackgroundWorkerAlert instance);
 partial void DeleteBackgroundWorkerAlert(BackgroundWorkerAlert instance);
 partial void InsertBackgroundWorkerAlert(BackgroundWorkerAlert instance);