Francesco Belladonna
Francesco Belladonna

Reputation: 11689

C#: Which is an already serializable collection (I mean, created from microsoft)

I need to serialize a collection, but I would like to know if there is any already serializable collection before taking code from third parts or write it by myself. I already implemented some serializable collection, but this is a stupid situation where I just need to pass an array of serializable classes to the clipboard and back from it (copy/paste).

Any suggestion on what should I use?

Upvotes: 6

Views: 6336

Answers (2)

Femaref
Femaref

Reputation: 61437

Any class in the System.Collections or System.Collections.Generic namespace should be serializable. However, this doesn't mean that the content (or in the case of generics, T is serializable). This is visible with Dictionary<K,V>, as KeyValuePair<K,V> isn't directly serializable.

Upvotes: 9

ysrb
ysrb

Reputation: 6740

I used List<T> before and it works great.

Upvotes: 2

Related Questions