Ejemplo n.º 1
0
 /// <summary>
 /// Raises the <see cref="AfterCreation"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 internal virtual void FireAfterCreation(DatabaseCreationEventArgs e)
 {
     if (AfterCreation != null)
     {
         AfterCreation(e);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Raises the <see cref="BeforeCreation"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 internal virtual void FireBeforeCreation(DatabaseCreationEventArgs e)
 {
     if (BeforeCreation != null)
     {
         BeforeCreation(e);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize the database by creating the umbraco db schema
        /// </summary>
        public void InitializeDatabaseSchema()
        {
            var e = new DatabaseCreationEventArgs();

            FireBeforeCreation(e);

            if (!e.Cancel)
            {
                DatabaseSchemaHelper.InitializeDatabaseSchema(_database, OrderedTables, MerchelloVersion.Current.ToString());
            }

            FireAfterCreation(e);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initialize the database by creating the umbraco db schema
        /// </summary>
        public void InitializeDatabaseSchema()
        {
            var e = new DatabaseCreationEventArgs();

            FireBeforeCreation(e);

            if (!e.Cancel)
            {
                foreach (var item in OrderedTables.OrderBy(x => x.Key))
                {
                    _schemaHelper.CreateTable(false, item.Value);
                }
            }

            FireAfterCreation(e);
        }
        /// <summary>
        /// Initializes the database by creating the umbraco db schema.
        /// </summary>
        /// <remarks>This needs to execute as part of a transaction.</remarks>
        public void InitializeDatabaseSchema()
        {
            if (!_database.InTransaction)
            {
                throw new InvalidOperationException("Database is not in a transaction.");
            }

            var e = new DatabaseCreationEventArgs();

            FireBeforeCreation(e);

            if (e.Cancel == false)
            {
                var dataCreation = new DatabaseDataCreator(_database, _logger);
                foreach (var table in OrderedTables)
                {
                    CreateTable(false, table, dataCreation);
                }
            }

            FireAfterCreation(e);
        }
 /// <summary>
 /// Raises the <see cref="AfterCreation"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected virtual void FireAfterCreation(DatabaseCreationEventArgs e)
 {
     if (AfterCreation != null)
     {
         AfterCreation(e);
     }
 }
 /// <summary>
 /// Raises the <see cref="BeforeCreation"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected internal virtual void FireBeforeCreation(DatabaseCreationEventArgs e)
 {
     if (BeforeCreation != null)
     {
         BeforeCreation(e);
     }
 }
        /// <summary>
        /// Initialize the database by creating the umbraco db schema
        /// </summary>
        public void InitializeDatabaseSchema()
        {
            var e = new DatabaseCreationEventArgs();
            FireBeforeCreation(e);

            if (!e.Cancel)
            {
                foreach (var item in OrderedTables.OrderBy(x => x.Key))
                {
                    _database.CreateTable(false, item.Value);
                }
            }

            FireAfterCreation(e);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Initialize the database by creating the umbraco db schema
        /// </summary>
        public void InitializeDatabaseSchema()
        {
            var e = new DatabaseCreationEventArgs();
            FireBeforeCreation(e);

            if (!e.Cancel)
            {
                DatabaseSchemaHelper.InitializeDatabaseSchema(_database, OrderedTables, MerchelloVersion.Current.ToString());
            }

            FireAfterCreation(e);
        }
 /// <summary>
 /// Raises the <see cref="AfterCreation"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 internal virtual void FireAfterCreation(DatabaseCreationEventArgs e)
 {
     AfterCreation?.Invoke(e);
 }
 /// <summary>
 /// Raises the <see cref="BeforeCreation"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 internal virtual void FireBeforeCreation(DatabaseCreationEventArgs e)
 {
     BeforeCreation?.Invoke(e);
 }