Exemple #1
0
        public static void ToUpdateLog <T>(T model, int historyId)
        {
            SynergyResponse response = model as SynergyResponse;

            if (response != null)
            {
                UpdateHistory(historyId, response);
            }
        }
Exemple #2
0
 private static void UpdateHistory(int historyId, SynergyResponse response)
 {
     using (var context = new SynergyDbContext())
     {
         var history = context.Synergy_ApiHistory.Where(x => x.Id == historyId && x.IsActive).FirstOrDefault();
         if (history != null)
         {
             history.Message = string.IsNullOrEmpty(response.Message) ? "Processed successfully." : response.Message;
             history.Status  = response.Status.ToString();
             context.SaveChanges();
         }
     }
 }