The user will be giving schema information during runtime, and then data which follows the schema.
For instance:
- asked for class name => Person.
- asked for number of attributes => 2.
- asked for attribute with data types => Name, string; Age, integer.
This should create a class in C# as:
class Person
{
string Name;
int Age;
}
Then asked for data- Abc,25; Def,30.
So it creates 2 objects of type Person.
The template class would already be there in the project, the attributes and data will be given during runtime, and during the same runtime the objects are created of that class.
I have tried Text Template Transformation Toolkit (T4), and used their design templates, but it takes the schema information during design time, via accessing a xml config file, and creates the classes. Then data is given during runtime.
Is there anyway to give even the schema information during runtime?
T4 also has runtime templates, but from my understanding, that generates text files to be used outside the context of the C# project, whereas design time templates can be used to give C# classes to be used in same project. Correct me if I am wrong.