Can I use templates dynamically?
<p>I have a class:</p>

<pre><code>class abc &lt;T&gt; {
  private T foo; 
  public string a {
    set {
       foo = T.parse(value);
    }

    get{
       return foo.toString();
    }

  }
}
</code></pre>

<p>However the T.parse command is giving me an error. Anyone of a way to do what I am trying to do?</p>

<p>I am using this as a base class for some other derived classes.</p>

<p>Edit:</p>

<p>What I ended us doing:</p>

<pre><code>Delegate parse = Delegate.CreateDelegate(typeof(Func&lt;String, T&gt;), typeof(T).GetMethod("Parse", new[] { typeof(string) }));
</code></pre>

<p>I do that once in the constructor</p>

<p>and then I do the following in my property:</p>

<pre><code>        lock (lockVariable)
        {
            m_result = (T)parse.DynamicInvoke(value);
            dirty = true;
        } 
</code></pre>
