/// <summary> /// Called after the save operation is executed. /// </summary> protected override void PostSave() { base.PostSave(); var contentChannelItemSerivce = new ContentChannelItemService(RockContext); var contentChannelSlugSerivce = new ContentChannelItemSlugService(RockContext); if (!contentChannelSlugSerivce.Queryable().Any(a => a.ContentChannelItemId == Entity.Id) && contentChannelItemSerivce.Queryable().Any(a => a.Id == Entity.Id)) { contentChannelSlugSerivce.SaveSlug(Entity.Id, Entity.Title, null); } }
/// <summary> /// Posts the save changes. /// </summary> /// <param name="dbContext">The database context.</param> public override void PostSaveChanges(Data.DbContext dbContext) { base.PostSaveChanges(dbContext); var rockContext = ( RockContext )dbContext; var contentChannelItemSerivce = new ContentChannelItemService(rockContext); var contentChannelSlugSerivce = new ContentChannelItemSlugService(rockContext); if (!contentChannelSlugSerivce.Queryable().Any(a => a.ContentChannelItemId == this.Id) && contentChannelItemSerivce.Queryable().Any(a => a.Id == Id)) { contentChannelSlugSerivce.SaveSlug(Id, Title, null); } }