With the following code:
Code: Select all
[Table]
public class Customer
{
[Column( IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert )]
public int Id { get; set; }
...
}
public class Database
{
public static void Create( DataContext context )
{
if( !context.DatabaseExists() )
{
context.GetTable();
context.CreateDatabase();
context.SubmitChanges();
}
}
}
The only solution I could think of was to use a MySqlCommand to alter the table after the database is created - is there a better way?
Thanks,
Paul