Exemple #1
0
        public void CreateTable(string tableName, Action <CreateTableContext> action = null)
        {
            Func <string, string> format = x => string.Format(TableFormat, x);
            string formatedTableName     = format(tableName);
            bool   result = CheckTableExists(formatedTableName);

            if (result)
            {
                return;
            }
            _schemaBuilder.CreateTable(formatedTableName,
                                       table => {
                table.Column <int>("Id", column => column.PrimaryKey())
                .Column <int>("ContentItemRecord_id");
                if (action != null)
                {
                    var context = new CreateTableContext(_dynamicAssemblyBuilder, table);
                    action(context);
                }
            });
            GenerationDynmicAssembly();
        }
 public void CreateTable(string tableName, Action<CreateTableContext> action = null) {
     Func<string, string> format = x => string.Format(TableFormat, x);
     string formatedTableName = format(tableName);
     bool result = CheckTableExists(formatedTableName);
     if (result) {
         return;
     }
     _schemaBuilder.CreateTable(formatedTableName,
         table => {
             table.Column<int>("Id", column => column.PrimaryKey())
                 .Column<int>("ContentItemRecord_id");
             if (action != null) {
                 var context = new CreateTableContext(_dynamicAssemblyBuilder, table);
                 action(context);
             }
         });
     GenerationDynmicAssembly();
 }