How to serialize an interface (protobuf-net)?
<p>want serialize SomeInterface that is contened SomeClass that declared in another dll. There is also the implementation of this interface.  </p>

<pre><code>public interface SomeInterface
{
     SomeClass Instance { get; }
}

public class BasicClass : SomeInterface
{
    public BasicClass(SomeClass instance)
    {
         Instance = instance;
    }

    public SomeClass Instance { get; }

    public override string ToString()
    {
         return Instance.ToDisplayString();
    }

}
</code></pre>

<p>If you use a <em>Surrogate</em>, you can not use <em>implicit operator</em> for <em>Interface</em>.</p>

<pre><code>[ProtoContract]
class SomeInterfaceSurrogate
{ 
      [ProtoMember(1)] public int Id { get; set; }

      public static implicit operator SomeInterface(SomeInterfaceSurrogate value)
      {
            return value == null ? null : GetInstanceForId(int id);
      }

      public static implicit operator SomeInterfaceSurrogate(SomeInterface value)
      {   
            return value == null ? null : new SomeInterfaceSurrogate()
            {
                  Id = value.GetId()
            };
      }
}
</code></pre>

<p>What are the tools protobuf for such tasks?</p>