Dynamically create objects knowing only System.Type

  • Thread starter Thread starter Saranjit Singh
  • Start date Start date
S

Saranjit Singh

Is there any way I can enumerate the properties of an object at runtime and
assign values to each property of the object depending on its data type? For
primitive data types, this is easily done using reflection since they are
basically numeric data. But for structures (or for that matter classes), I
am not sure how to create a new structure at runtime by just knowing its
System.Type and assign random values to its members. Any help would be
appreciated. Thanks.

Saranjit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top