Interface IContentServiceOperations
A temporary interface until we are in v8, this is used to return a different result for the same method and this interface gets implemented explicitly. These methods will replace the normal ones in IContentService in v8 and this will be removed.
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public interface IContentServiceOperations
Methods
Delete(IContent, Int32)
Permanently deletes an IContent object.
Declaration
Attempt<OperationStatus> Delete(IContent content, int userId = 0)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to delete |
System.Int32 | userId | Optional Id of the User deleting the Content |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
Remarks
This method will also delete associated media files, child content and possibly associated domains.
MoveToRecycleBin(IContent, Int32)
Deletes an IContent object by moving it to the Recycle Bin
Declaration
Attempt<OperationStatus> MoveToRecycleBin(IContent content, int userId = 0)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to delete |
System.Int32 | userId | Optional Id of the User deleting the Content |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
Remarks
Move an item to the Recycle Bin will result in the item being unpublished
Publish(IContent, Int32)
Publishes a single IContent object
Declaration
Attempt<PublishStatus> Publish(IContent content, int userId = 0)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to publish |
System.Int32 | userId | Optional Id of the User issueing the publishing |
Returns
Type | Description |
---|---|
Attempt<PublishStatus> | The published status attempt |
PublishWithChildren(IContent, Int32, Boolean)
Publishes a IContent object and all its children
Declaration
IEnumerable<Attempt<PublishStatus>> PublishWithChildren(IContent content, int userId = 0, bool includeUnpublished = false)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to publish along with its children |
System.Int32 | userId | Optional Id of the User issueing the publishing |
System.Boolean | includeUnpublished |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Attempt<PublishStatus>> | The list of statuses for all published items |
Save(IEnumerable<IContent>, Int32, Boolean)
Saves a collection of IContent objects.
Declaration
Attempt<OperationStatus> Save(IEnumerable<IContent> contents, int userId = 0, bool raiseEvents = true)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IContent> | contents | Collection of IContent to save |
System.Int32 | userId | Optional Id of the User saving the Content |
System.Boolean | raiseEvents | Optional boolean indicating whether or not to raise events. |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
Save(IContent, Int32, Boolean)
Saves a single IContent object
Declaration
Attempt<OperationStatus> Save(IContent content, int userId = 0, bool raiseEvents = true)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to save |
System.Int32 | userId | Optional Id of the User saving the Content |
System.Boolean | raiseEvents | Optional boolean indicating whether or not to raise events. |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
SaveAndPublish(IContent, Int32, Boolean)
Saves and Publishes a single IContent object
Declaration
Attempt<PublishStatus> SaveAndPublish(IContent content, int userId = 0, bool raiseEvents = true)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to save and publish |
System.Int32 | userId | Optional Id of the User issueing the publishing |
System.Boolean | raiseEvents | Optional boolean indicating whether or not to raise save events. |
Returns
Type | Description |
---|---|
Attempt<PublishStatus> | True if publishing succeeded, otherwise False |
UnPublish(IContent, Int32)
UnPublishes a single IContent object
Declaration
Attempt<UnPublishStatus> UnPublish(IContent content, int userId = 0)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The IContent to publish |
System.Int32 | userId | Optional Id of the User issueing the publishing |
Returns
Type | Description |
---|---|
Attempt<UnPublishStatus> | True if unpublishing succeeded, otherwise False |