private async Task UpdateDestinationAsync(string operation, TeamActivityModel activityModel, DeltaModel <T> delta, T record, Func <string, T, bool, Task> destinationMethod, ILogger log)
 {
     try
     {
         await destinationMethod(activityModel.TeamId, record, false).ConfigureAwait(false);
     }
     catch (ArgumentException)
     {
         delta.SkippedChange(record);
         LogRecordSkipped(activityModel, operation, record, log);
     }
     catch (Exception ex)
     {
         delta.FailedChange(record);
         LogRecordError(ex, activityModel, operation, record, log);
     }
 }
示例#2
0
 private async Task UpdateDestinationAsync(string operation, WeekModel weekModel, DeltaModel delta, ShiftModel shift, Func <string, ShiftModel, Task> destinationMethod, ILogger log)
 {
     try
     {
         await destinationMethod(weekModel.TeamId, shift);
     }
     catch (ArgumentException)
     {
         delta.SkippedChange(shift);
         log.LogShiftSkipped(weekModel, operation, shift);
     }
     catch (MicrosoftGraphException ex)
     {
         delta.FailedChange(shift);
         log.LogShiftError(ex, weekModel, operation, shift);
     }
     catch (Exception ex)
     {
         delta.FailedChange(shift);
         log.LogShiftError(ex, weekModel, operation, shift);
     }
 }