title: Enforcing serializable from an interface without forcing classes to custom serialize in C#
body: <p>I have an interface that defines some methods I would like certain classes to implement.</p>
  
  <pre>
  public interface IMyInterface
  {
      MethodA;
      MethodB;
  }
  </pre>
  
  <p>Additionally I would like all classes implementing this interface to be serializable. If I change the interface definition to implement ISerializable as below...:</p>
  
  <pre>
  public interface IMyInterface : ISerializable
  {
      MethodA;
      MethodB;
  }
  </pre>
  
  <p>...all classes must now explicitly implement serialization as far as I am aware, since if you implement ISerializable you must implement the GetObjectData member (and the necessary constructor to deserialize).</p>
  
  <p>How can I insist classes using my interface be serializable, but without forcing them to custom implement serialization?</p>
  
  <p>Thanks,
  Will</p>