Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serialize List<Func<T>>

I have a class which contains a List<Func<T>>. The class is serializable and will be transferred over WCF. Now, I have problems with contained List<Func<T>>. What can I do that this list will also be serializable?

like image 356
BennoDual Avatar asked Oct 18 '12 17:10

BennoDual


People also ask

Can you serialize a list?

A List can be serialized—here we serialize (to a file) a List of objects.

How do you serialize a list in Python?

Use json. dumps() to serialize a list into a JSON object. Use json. dumps(list) to serialize list into a JSON string.

How do you serialize a list in Java?

In Java, ArrayList class is serializable by default. It essentially means that we do not need to implement Serializable interface explicitly in order to serialize ArrayList. We can directly use ObjectOutputStream to serialize ArrayList, and ObjectInputStream to deserialize an arraylist object.

What is a serialize function?

The serialize() function converts a storable representation of a value. To serialize data means to convert a value to a sequence of bits, so that it can be stored in a file, a memory buffer, or transmitted across a network.


1 Answers

How would you expect a Func<T> to be serialized? It's a pointer to a function - such a thing cannot be serialized.

like image 110
John Saunders Avatar answered Sep 30 '22 18:09

John Saunders