/// <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(); } }
/// <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); }
/// <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); }