예제 #1
0
 /// <summary>
 /// Pres the save.
 /// </summary>
 /// <param name="dbContext">The database context.</param>
 /// <param name="state">The state.</param>
 public override void PreSaveChanges(DbContext dbContext, System.Data.Entity.EntityState state)
 {
     if (state == System.Data.Entity.EntityState.Deleted)
     {
         ChildItems.Clear();
         ParentItems.Clear();
     }
 }
예제 #2
0
        /// <summary>
        /// Pres the save.
        /// </summary>
        /// <param name="dbContext">The database context.</param>
        /// <param name="state">The state.</param>
        public override void PreSaveChanges(Data.DbContext dbContext, System.Data.Entity.EntityState state)
        {
            var channel = this.ContentChannel;

            if (state == System.Data.Entity.EntityState.Deleted)
            {
                ChildItems.Clear();
                ParentItems.Clear();
            }

            base.PreSaveChanges(dbContext, state);
        }
예제 #3
0
        /// <summary>
        /// Pres the save.
        /// </summary>
        /// <param name="dbContext">The database context.</param>
        /// <param name="state">The state.</param>
        public override void PreSaveChanges(Data.DbContext dbContext, EntityState state)
        {
            var channel = this.ContentChannel;

            if (state == EntityState.Deleted)
            {
                ChildItems.Clear();
                ParentItems.Clear();

                DeleteRelatedSlugs(dbContext);
            }
            else
            {
                AssignItemGlobalKey(dbContext);
            }

            base.PreSaveChanges(dbContext, state);
        }