Serializable

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am using ASP.NET Membership and I know each class that I add to
Profile must be Serializable:

[Serializable()]
public class Contacts {
public string Address { get; set; }
}

But can I have the following:

[Serializable()]
public class Contacts {
public Address Address { get; set; }
}

Address is a new class. I suppose I can use it but I also need to make
it Serializable, right?

Thanks,
Miguel
 
shapper said:
[Serializable()]
public class Contacts {
public Address Address { get; set; }
}

Address is a new class. I suppose I can use it but I also need to make
it Serializable, right?

Right. For a class to be Serializable, all the contents need to be
themselves Serializable, unless you implement custom serialization to
serialize the class yourself.
 
 [Serializable()]
 public class Contacts {
    public Address Address { get; set; }
 }
Address is a new class. I suppose I can use it but I also need to make
it Serializable, right?

   Right. For a class to be Serializable, all the contents need to be
themselves Serializable, unless you implement custom serialization to
serialize the class yourself.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top