void IContentStorageFilter.Destroyed(DestroyContentContext context) { if (context.ContentItem.Is <TPart>()) { Destroyed(context, context.ContentItem.As <TPart>()); } }
protected override void Destroyed(DestroyContentContext context, TPart instance) { if (OnDestroyed != null) { OnDestroyed(context, instance); } }
void IContentHandler.Destroyed(DestroyContentContext context) { foreach (var filter in Filters.OfType <IContentStorageFilter>()) { filter.Destroyed(context); } Destroyed(context); }
protected override void Destroying(DestroyContentContext context, ContentPart <TRecord> instance) { // Get all content item version records. var allVersions = context.ContentItem.Record.Versions.ToArray(); // For each version record, delete its part record (ID of versioned part records is the same as the ID of a version record). foreach (var versionRecord in allVersions) { var partRecord = _repository.Get(versionRecord.Id); if (partRecord != null) { _repository.Delete(partRecord); } } }
protected virtual void Destroyed(DestroyContentContext context) { }
public void Destroying(DestroyContentContext context) { }
public void Destroyed(DestroyContentContext context) { }
protected virtual void Destroyed(DestroyContentContext context, TPart instance) { }
public virtual void Destroyed(DestroyContentContext context) { }
protected override void Destroyed(DestroyContentContext context) { RecordAuditTrailEvent(ContentAuditTrailEventProvider.Destroyed, context.ContentItem); }
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); }