How to store a collection of classes of the type 'Class<T>' without a defining T type
<p>I've run into a little difficulty and I'm not sure how best to solve this issue. </p>

<p>I wrote a class that expects data type to be specified upon the creation of a new instance. Much like in the same way as the <code>System.Collections.Generic.List&lt;T&gt;</code> class that stores a number of items of a specified type. However my class doesn't has the same or similar function as the <code>List&lt;T&gt;</code> class does.</p>

<p>Upon creation of a new instance of my class, for example:</p>

<pre><code>string phrase = "Some string type data.";
MyClass&lt;string&gt; data = new MyClass&lt;string&gt;( () =&gt; phrase );
</code></pre>

<p>Afterwards my class would provide a number of methods that would give a result regardless of the type of data being imparted into <code>MyClass&lt;T&gt;</code> (where <code>T</code> is the data type). Doesn't matter if it is string, bool, int, or any kind.</p>

<p>I've tested my class and it works as expected, now how can I store a number of elements of <code>MyClass</code> but each element with different imparted data type, inside a collection class such as <code>List&lt;&gt;</code>.</p>

<p>Let me exemplify (code will contain syntax errors since I'm not sure how to write correctly):</p>

<pre><code>// My intent... Not sure how to do it.
string phrase = "Some string data type.";
int number = 23;
bool boolData = false;

List&lt;MyClass&lt;T&gt;&gt; list = new List&lt;MyClass&lt;T&gt;&gt;();

list.Add( new MyClass&lt;string&gt;( () =&gt; phrase ) );
list.Add( new MyClass&lt;int&gt;( () =&gt; number ) );
list.add( new MyClass&lt;bool&gt;( () =&gt; boolData ) );
</code></pre>

<p>As you see I don't know how to store a number of element of MyClass with different imparted data types, if they were all the same imparted data type, I wouldn't be having this issue.</p>

<p>For example:</p>

<pre><code>// How it should be done. But not what I need.
string phrase1 = "Hello Phrase 1.";
string phrase2 = "Hello Phrase 2.";

List&lt;MyClass&lt;string&gt;&gt; list = new List&lt;MyClass&lt;string&gt;&gt;();

list.Add(new MyClass&lt;string&gt;( () =&gt; phrase1) );
list.Add(new MyClass&lt;string&gt;( () =&gt; phrase2) );
</code></pre>

<p>If this was what I wanted to accomplish, I wouldn't have a problem, but since I want to accomplish what I exemplified before this last example, I'm just not sure how to best do it.</p>

<p>Basically thats my issue, I've provided a few basic examples because I believe my question might be a bit odd, and to be honest my terminology wouldn't not be adequate I think.</p>

<p>This is probably quite simple for some of you. My thanks for your help.</p>
