void IContentStorageFilter.Destroyed(DestroyContentContext context) { if (context.ContentItem.Is <TPart>()) { Destroyed(context, context.ContentItem.As <TPart>()); } }
public void Destroy(ContentItem contentItem) { var session = _sessionLocator.Value.For(typeof(ContentItemRecord)); var context = new DestroyContentContext(contentItem); // Give storage filters a chance to delete content part records. Handlers.Invoke(handler => handler.Destroying(context), Logger); // Delete the content item record itself. session .CreateQuery("delete from Orchard.ContentManagement.Records.ContentItemRecord ci where ci.Id = (:id)") .SetParameter("id", contentItem.Id) .ExecuteUpdate(); Handlers.Invoke(handler => handler.Destroyed(context), Logger); }
public virtual void Destroy(ContentItem contentItem) { var session = _transactionManager.Value.GetSession(); var context = new DestroyContentContext(contentItem); // Give storage filters a chance to delete content part records. Handlers.Invoke(handler => handler.Destroying(context), Logger); // Delete content item version and content item records. session .CreateQuery("delete from Orchard.ContentManagement.Records.ContentItemVersionRecord civ where civ.ContentItemRecord.Id = (:id)") .SetParameter("id", contentItem.Id) .ExecuteUpdate(); // Delete the content item record itself. session .CreateQuery("delete from Orchard.ContentManagement.Records.ContentItemRecord ci where ci.Id = (:id)") .SetParameter("id", contentItem.Id) .ExecuteUpdate(); Handlers.Invoke(handler => handler.Destroyed(context), Logger); }
public virtual void Destroyed(DestroyContentContext context) {}
protected virtual void Destroyed(DestroyContentContext context, TPart instance) { }
public void Destroyed(DestroyContentContext context) { }
public void Destroying(DestroyContentContext context) { }
protected override void Destroyed(DestroyContentContext context) { RecordAuditTrailEvent(ContentAuditTrailEventProvider.Destroyed, context.ContentItem); }