0

I have several Employee objects which are all SerializableAttributes. This is due to WCF, because these are objects passed between the client and the server.

I would now like to save and load several of these, either to a file or by using System.Properties namespace. With the System properties, I could not find a way to save them because the types that are allowed are pretty limited: int, string, float and some others. There's nothing involving serializable, and the only collection available is a string collection.

What would be the best approach? I'm not sure what is the proper way to save a collection, like List<> of SerializableAttributes to a file. Otherwise, I can use System.properties and I could do it the "hard way" by converting the objects to strings and back, but this approach will be pretty ugly.

David
  • 15,652
  • 26
  • 115
  • 156

1 Answers1

0

You have many alternatives such as: JavaScriptSerializer XmlSerializer DataContractSerializer DataContractJsonSerializer BinaryFormatter SoapFormatter.

(BTW: Serializable attribute is only used by BinaryFormatter and no need for WCF)

I4V
  • 34,891
  • 6
  • 67
  • 79