Open Perret opened 11 years ago
I have been tempted to add explicit table names, so you could do something like:
db.CreateTable
etc.
Would that help?
Sometimes the table has to be created following a user definition, i.e the columns can't be hardcoded either. Well maybe there is no solution and I'm stuck with old fashion Strings =/.
Maybe a first trick could be to have a decent syntax for creating different table based on the same schema but with different name using something like:
db.CreateTable
Did you try Inheritance?
public class MyClass
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[MaxLength(255)]
public string Name { get; set; }
// ...
}
public class MyClass2 : MyClass
{
}
Yes but can you generate new inherited classes without hardcoding?
Hi
Is there any way to create different tables dynamically (i.e. without hardcoding many class definitions) based on one class (cause I don't think that new classes can be generated on fly), or at least same definition but with a different name?
Thanks
EDIT: and without using an command "CREATE TABLE " etc... i'm not sure if someone has suceeded to create Table suing some reflection tricks.