dynamically create a class in c#.net
<p>I want to dynamically create a class in c#.net.</p>

<p>I tried using anonymous methods since the number of member variables is given dynamically,
i tried like this, </p>

<pre><code>string element = "element";
string str = String.Empty;
for (int i = 0; i &lt; elementsCount; i++)
{
    str = String.Concat(str, element + i, "=String.Empty", ",");
    if (i == elementsCount - 1)
        str = String.Concat(str, element + i, "=String.Empty");
}
string s = "new{" + str + "}";
var a=s;
</code></pre>

<p>and </p>

<p>i want to assign the class 'a' like ObservableCollection but i could not do this.</p>

<p>Is there any way to do these two??
but this is not the right way i guess;</p>
