Is there a way I can generate a class with all the properties obtained from a List<string>?
<p>I have a List object. In the code, I want to declare a new class , and its attributes, which are dynamically generated, are all obtained from the List object. Is there a way I can do this?</p>

<p>For example: I have a <code>List&lt;string&gt; lstStr= "apple, pear, banana";</code> and I want to generate a new class in the code:</p>

<pre><code>Class Foo{
   string apple;
   string pear;
   string banana;
}
</code></pre>
