void FilterEvent(IContentService sender, Umbraco.Core.Events.RollbackEventArgs <IContent> e) { //check if this is a valid content type if (ContentTypeAliases.Contains(e.Entity.ContentType.Alias)) { MethodToBind.Invoke(null, new object[] { sender, e }); } }
protected void ContentService_RolledBack(IContentService sender, Umbraco.Core.Events.RollbackEventArgs <IContent> e) { // Remove any cache associated to the modified content nodes Routing.Helpers.CacheHelper.Remove(string.Format(Routing.Constants.Cache.NodeDependencyCacheIdPattern, e.Entity.Id)); new Controllers.PersistentCacheController().Remove(e.Entity.Id); // Remove all Ulrs cached for which no content node was found Routing.Helpers.CacheHelper.Remove(string.Format(Routing.Constants.Cache.NodeDependencyCacheIdPattern, 0)); new Controllers.PersistentCacheController().Remove(0); }
public void ContentService_RolledBack(Umbraco.Core.Services.IContentService sender, Umbraco.Core.Events.RollbackEventArgs <Umbraco.Core.Models.IContent> e) { var properties = new PropertiesDictionary(e.Entity); AsyncUtil.RunSync(() => _messagingService.SendMessageAsync("contentService", "rolledBack", properties)); }