mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 09:44:20 +08:00
Adding IContentManager.Clear() method
--HG-- branch : 1.x
This commit is contained in:
@@ -528,6 +528,12 @@ namespace Orchard.ContentManagement {
|
||||
return _contentDisplay.Value.UpdateEditor(content, updater, groupId);
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
var session = _sessionLocator.Value.For(typeof(ContentItemRecord));
|
||||
session.Clear();
|
||||
_contentManagerSession().Clear();
|
||||
}
|
||||
|
||||
public IContentQuery<ContentItem> Query() {
|
||||
var query = _context.Resolve<IContentQuery>(TypedParameter.From<IContentManager>(this));
|
||||
return query.ForPart<ContentItem>();
|
||||
|
@@ -21,5 +21,10 @@ namespace Orchard.ContentManagement {
|
||||
public bool RecallContentRecordId(int id, out ContentItem item) {
|
||||
return _publishedItemsByContentRecordId.TryGetValue(id, out item);
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
_itemByVersionRecordId.Clear();
|
||||
_publishedItemsByContentRecordId.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -77,6 +77,11 @@ namespace Orchard.ContentManagement {
|
||||
/// Flushes all pending content items to the persistance layer
|
||||
/// </summary>
|
||||
void Flush();
|
||||
|
||||
/// <summary>
|
||||
/// Clears the current referenced content items
|
||||
/// </summary>
|
||||
void Clear();
|
||||
|
||||
/// <summary>
|
||||
/// Query for arbitrary content items
|
||||
|
@@ -3,5 +3,7 @@
|
||||
void Store(ContentItem item);
|
||||
bool RecallVersionRecordId(int id, out ContentItem item);
|
||||
bool RecallContentRecordId(int id, out ContentItem item);
|
||||
|
||||
void Clear();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user