mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Brought over some extension methods on IContentManager to simplify the API
--HG-- branch : dev
This commit is contained in:
@@ -21,6 +21,14 @@ namespace Orchard.ContentManagement {
|
||||
return part;
|
||||
}
|
||||
|
||||
public static void Create(this IContentManager manager, IContent content) {
|
||||
manager.Create(content.ContentItem, VersionOptions.Draft);
|
||||
manager.Publish(content.ContentItem);
|
||||
}
|
||||
|
||||
public static void Create(this IContentManager manager, IContent content, VersionOptions options) {
|
||||
manager.Create(content.ContentItem, options);
|
||||
}
|
||||
|
||||
public static ContentItem Create(this IContentManager manager, string contentType) {
|
||||
return manager.Create<ContentItem>(contentType, init => { });
|
||||
|
Reference in New Issue
Block a user