I have a class which looks like this:

public class Field
{
    public string FieldName;
    public string FieldType;
}

And an object List<Field> with values:

{"EmployeeID","int"},
{"EmployeeName","String"},
{"Designation","String"}

I want to create a class that looks like this:

Class DynamicClass
{
    int EmployeeID,
    String EmployeeName,
    String Designation
}

Is there any way to do this?

I want this to be generated at runtime. I don’t want a physical CS file residing in my filesystem.

15 Answers
15

Leave a Reply

Your email address will not be published. Required fields are marked *