Пример #1
0
        internal MySqlCrudCommand GetMySqlCrudCommand(Entity entity)
        {
            MySqlCrudCommand command;

            if (!Commands.TryGetValue(entity, out command))
            {
                command = new MySqlCrudCommand(entity, this);
                Commands.Add(entity, command);
            }

            return(command);
        }
Пример #2
0
        internal override void Create(Entity entity)
        {
            CurrentOperation = DatabaseOperation.CREATE;

            MySqlCrudCommand command = GetMySqlCrudCommand(entity);
            //if (command.MySqlConnection.SchemaCreationPriority == SchemaCreationPriority.FrameworkFirst)
            //{
            //    MySqlCommand dropTableCommand = command.DropTableCommand;
            //    dropTableCommand.Transaction = Transaction;
            //    dropTableCommand.ExecuteNonQuery();
            //}

            MySqlCommand createCommand = command.CreateCommand;

            createCommand.Transaction = Transaction;
            createCommand.ExecuteNonQuery();
        }