title: WCF: Is it safe to override the Client's Dispose method using a partial class?
body: <p>I'd like to override the Dispose method of generated proxy (<code>ClientBase</code>) because of the fact that disposing of a proxy calls Close and can throw an exception when the channel is faulted. </p>
  
  <p>The only way I came up was to create a partial class to my generated proxy, make it inherit from <code>IDisposable</code>:</p>
  
  <pre><code> public partial class MyServiceProxy : IDisposable
      {
          #region IDisposable Members
  
          public void Dispose()
          {
              if (State != System.ServiceModel.CommunicationState.Faulted)
                  Close();
              else
                  Abort();
          }
  
          #endregion
      }
  </code></pre>
  
  <p>I did some test and my <code>Dispose</code> method is indeed called. </p>
  
  <p>Do you see any issue with this strategy?</p>
  
  <p>Also, I don't like the fact that I'll have to create this partial class for every generated proxy. </p>
  
  <p>It be nice if I was able to make my proxy inherit from a base class... </p>