private static void BeginProcessingUserDetails(DateTime from, IPlugin loadedPlugin) { Log.Debug($"BeginProcessingUserDetails(), {nameof(from)}:{@from:O}, {nameof(To)}:{To:O}"); try { if (from.Equals(DateTime.MinValue)) { throw new ArgumentException("Equals(DateTime.MinValue)", nameof(from)); } // a legacy condition, not sure is it necessary at all // <calculating intervals> var intervalList = new List <Interval>(); var tempFrom = from; while (To.Subtract(tempFrom).TotalDays >= MaxIntervalDurationDays) { var tempTo = tempFrom.AddDays(MaxIntervalDurationDays).Date.AddTicks(-1); intervalList.Add(new Interval(tempFrom, tempTo)); tempFrom = tempTo.AddDays(1).Date; } intervalList.Add(new Interval(tempFrom, To)); // </calculating intervals> // <getting the data> foreach (var interval in intervalList) { var userDetailsData = PureCloudObj.GetUserDetails(interval); if (userDetailsData == null || userDetailsData.Count < 1) { continue; } var conversationDataJson = "{\"userdetailsdata\":" + JsonConvert.SerializeObject(userDetailsData) + "}"; loadedPlugin.PushData(conversationDataJson); } // </getting the data> } catch (Exception ex) { Log.Error("BeginProcessingUserDetails()", ex); } }