title: RestSharp updating use of AddHandler method to use factory delegate
body: <p>The latest version of RestSharp v106.6.9 apparently makes some changes making the overrides of the AddHandler method of a Request obsolete such as this signature:</p>
  <pre><code>[Obsolete(&quot;Use the overload that accepts a factory delegate&quot;)]
  public void AddHandler(IDeserializer deserializer, params string[] contentTypes)
  </code></pre>
  <p>As it suggest to use the factory delegate form</p>
  <pre><code>public void AddHandler(string contentType, Func&lt;IDeserializer&gt; deserializerFactory)
  
  public void AddHandler(Func&lt;IDeserializer&gt; deserializerFactory, params string[] contentTypes)
  </code></pre>
  <p>Would anyone be able to point me to an example of implementing this.
  Or explain how to transform my use of a customSerializer implementing IDeserializer below, to a factory delegate:</p>
  <pre><code>RestClient.AddHandler(&quot;application/json&quot;, CustomJsonSerializer.Instance);
  
  
  public class CustomJsonSerializer : IDeserializer
  {
      public static CustomJsonSerializer Instance =&gt; new CustomJsonSerializer();
  
      public string ContentType
      {
          get =&gt; &quot;application/json&quot;;
          set { } // maybe used for Serialization?
      }
  
      public string DateFormat { get; set; }
  
      public string Namespace { get; set; }
  
      public string RootElement { get; set; }
  
      public T Deserialize&lt;T&gt;(IRestResponse response) =&gt; RestSharpResponseHandlers.DeserializeObject&lt;T&gt;(response);
  }
  </code></pre>