Iserializable to serialize readonly methods to be sent through webservice

Posted by george9170 on Stack Overflow See other posts from Stack Overflow or by george9170
Published on 2010-05-13T15:31:32Z Indexed on 2010/05/13 15:34 UTC
Read the original article Hit count: 340

Filed under:

I am sending an object through a webservice with readonly methods. I am using the Iserializable interface, assuming that I would no longer need a parameterless constructor. This is not true and I still cannot send my object over the wire.

public class Foo:  ISerializable
{
 public boolean IsBusy { get; private set;}
 protected Foo(SerializationInfo info, StreamingContext context) 
  {
this.IsBusy = info.GetBoolean("IsBusy");
 }
   void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
   {
 .AddValue("IsBusy", this.IsBusy);
  }

© Stack Overflow or respective owner

Related posts about c#