/// <summary>
 /// Generates an event hander for the integration options
 /// </summary>
 public static EventHandler <RestRequestEventArgs> CreateRequestingHandler(IntegrationQueryOptions options)
 {
     return((o, e) =>
     {
         if (options == null)
         {
             return;
         }
         else if (options?.IfModifiedSince.HasValue == true)
         {
             e.AdditionalHeaders[HttpRequestHeader.IfModifiedSince] = options?.IfModifiedSince.Value.ToString();
         }
         else if (!String.IsNullOrEmpty(options?.IfNoneMatch))
         {
             e.AdditionalHeaders[HttpRequestHeader.IfNoneMatch] = options?.IfNoneMatch;
         }
         if (options?.Lean == true)
         {
             e.Query.Add("_lean", "true");
         }
         if (options?.Expand != null)
         {
             e.Query.Add("_expand", options?.Expand.ToList());
         }
         if (options?.InfrastructureOptions?.Count > 0)
         {
             foreach (var inf in options?.InfrastructureOptions)
             {
                 e.Query.Add(inf.Key, inf.Value);
             }
         }
     });
 }