List<T> defined as member of class
<p>I have a list where i want the type to be definined by the call for example in the class i want something like</p>

<pre><code>public class ClassName
{
    public ListType&lt;T&gt; ListName { get; set; }
    // other class items
}
</code></pre>

<p>and then the usage to be what sets the class type like</p>

<pre><code>var className = new ClassName()
{
    ListType&lt;int&gt; = data
};
</code></pre>

<p>so basically thats what i want, i have it working using dynamic so the class is</p>

<pre><code>public class ClassName
{
    public ListType&lt;dynamic&gt; ListName { get; set; }
    // other class items
}
</code></pre>

<p>and the call is</p>

<pre><code>var className = new ClassName()
{
    ListType&lt;dynamic&gt; = data
};
</code></pre>

<p>this works but i would like to know if there is a better way to do this so i dont have to use dynamic</p>

<p>oh almost forgot to mention the ListType is</p>

<pre><code>public class ListType&lt;T&gt; : List&lt;T&gt;
{
}
</code></pre>

<p>and so doesnt fail by having different types passed to it</p>

<p>thanks</p>

<p>edit: 
realised my usage of the code on stack overflow differed from my code</p>

<p>the ListType has a constructor that takes 3 arguments so the usage is more</p>

<pre><code>var className = new ClassName()
{
    ListName = new ListType&lt;Type&gt;(x, y, z)
}
</code></pre>
