public void Remove(TEntity entity)
        {
            var callerInfo = LoggingExtensions.Caller();

            _profiler.Profile(
                () => _writerDelegate.Remove(entity),
                $"{callerInfo} - entity=[{JsonLogging.Serialize(entity)}];"
                );
        }
        public void AddRange(IEnumerable <TEntity> entities)
        {
            var callerInfo = LoggingExtensions.Caller();

            _profiler.Profile(
                () => _writerDelegate.AddRange(entities),
                $"{callerInfo} - entities=[{JsonLogging.Serialize(entities)}];"
                );
        }
예제 #3
0
 public void Undo()
 {
     _log.Error(
         $"function=[{MethodBase.GetCurrentMethod().Name}]; error=[\"Failed to Create Message\"]; message=[{JsonLogging.Serialize(_entity)}]");
 }
예제 #4
0
 public void Retry()
 {
     _log.Warn(
         $"function=[{MethodBase.GetCurrentMethod().Name}]; warn=[\"Retrying\"]; message=[{JsonLogging.Serialize(_entity)}];");
     Execute();
 }
예제 #5
0
 public void Execute()
 {
     try
     {
         _log.Info($"function=[{MethodBase.GetCurrentMethod().Name}]; type=[\"OffSite\"]");
         MockSync.Sync();
     }
     catch (TimeoutException ex)
     {
         _log.Error(
             $"function=[{MethodBase.GetCurrentMethod().Name}]; exception=[{ex.GetBaseException().Message}]; message=[{JsonLogging.Serialize(_entity)}];");
         Retry();
     }
     catch (Exception ex)
     {
         _log.Error(
             $"function=[{MethodBase.GetCurrentMethod().Name}]; exception=[{ex.GetBaseException().Message}]; message=[{JsonLogging.Serialize(_entity)}];");
         Undo();
     }
 }
예제 #6
0
 private string DataEventInformation(DataEvent <TEntity> dataEvent)
 {
     return($"entity=[{nameof(TEntity)}]; entity=[{JsonLogging.Serialize(dataEvent.Entity)}];");
 }