C# - How to use a interface for a generic list when serializing
<p>I have a generic list say and I want to serialize it.
I want to use a interface for the generic list which can't be serialized
so you have to use the instance. Like this
MyClass implements IMyClass.</p>

<pre><code>List&lt;IMyClass&gt; list = DeserializeMyClass(path);    //Can't do this right
</code></pre>

<p>So have to do this</p>

<pre><code>List&lt;MyClass&gt; list = DeserializeMyClass(path);
</code></pre>

<p>So question is can i now cast to </p>

<pre><code>List&lt;IMyClass&gt; ilist = (IMyClass)list;
</code></pre>

<p>Malcolm</p>
