Is it possible in runtime to create a class from DataTable where ColumnName will be dynamic-class properties?
Reading your comments, I undestood your mean. Just use Generics: using List fields to generate the objects. The code is quite simple:
public class DynClass
{
public DynClass()
{
_fields = new Dictionary();
}
private IDictionary _fields;
public IDictionary Fields
{
get { return _fields; }
}
}
public class TestGenericInstances
{
public TestGenericInstances()
{
Client cli = new Client("Ash", "99999999901");
/* Here you can create any instances of the Class.
* Also DynClass
* */
DynClass gen = new DynClass();
/* Add the fields
* */
gen.Fields.Add("clientName", cli);
/* Add the objects to the List
* */
List