mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +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);
|
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() {
|
public IContentQuery<ContentItem> Query() {
|
||||||
var query = _context.Resolve<IContentQuery>(TypedParameter.From<IContentManager>(this));
|
var query = _context.Resolve<IContentQuery>(TypedParameter.From<IContentManager>(this));
|
||||||
return query.ForPart<ContentItem>();
|
return query.ForPart<ContentItem>();
|
||||||
|
@@ -21,5 +21,10 @@ namespace Orchard.ContentManagement {
|
|||||||
public bool RecallContentRecordId(int id, out ContentItem item) {
|
public bool RecallContentRecordId(int id, out ContentItem item) {
|
||||||
return _publishedItemsByContentRecordId.TryGetValue(id, out item);
|
return _publishedItemsByContentRecordId.TryGetValue(id, out item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear() {
|
||||||
|
_itemByVersionRecordId.Clear();
|
||||||
|
_publishedItemsByContentRecordId.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -78,6 +78,11 @@ namespace Orchard.ContentManagement {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void Flush();
|
void Flush();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the current referenced content items
|
||||||
|
/// </summary>
|
||||||
|
void Clear();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query for arbitrary content items
|
/// Query for arbitrary content items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -3,5 +3,7 @@
|
|||||||
void Store(ContentItem item);
|
void Store(ContentItem item);
|
||||||
bool RecallVersionRecordId(int id, out ContentItem item);
|
bool RecallVersionRecordId(int id, out ContentItem item);
|
||||||
bool RecallContentRecordId(int id, out ContentItem item);
|
bool RecallContentRecordId(int id, out ContentItem item);
|
||||||
|
|
||||||
|
void Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user