Interface IMediaServiceOperations
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 IMediaServiceOperations
Methods
Delete(IMedia, Int32)
Permanently deletes an IMedia object
Declaration
Attempt<OperationStatus> Delete(IMedia media, int userId = 0)
Parameters
Type | Name | Description |
---|---|---|
IMedia | media | The IMedia to delete |
System.Int32 | userId | Id of the User deleting the Media |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
Remarks
Please note that this method will completely remove the Media from the database, but current not from the file system.
MoveToRecycleBin(IMedia, Int32)
Deletes an IMedia object by moving it to the Recycle Bin
Declaration
Attempt<OperationStatus> MoveToRecycleBin(IMedia media, int userId = 0)
Parameters
Type | Name | Description |
---|---|---|
IMedia | media | The IMedia to delete |
System.Int32 | userId | Id of the User deleting the Media |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
Save(IEnumerable<IMedia>, Int32, Boolean)
Saves a collection of IMedia objects
Declaration
Attempt<OperationStatus> Save(IEnumerable<IMedia> medias, int userId = 0, bool raiseEvents = true)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IMedia> | medias | Collection of IMedia to save |
System.Int32 | userId | Id of the User saving the Media |
System.Boolean | raiseEvents | Optional boolean indicating whether or not to raise events. |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |
Save(IMedia, Int32, Boolean)
Saves a single IMedia object
Declaration
Attempt<OperationStatus> Save(IMedia media, int userId = 0, bool raiseEvents = true)
Parameters
Type | Name | Description |
---|---|---|
IMedia | media | The IMedia to save |
System.Int32 | userId | Id of the User saving the Media |
System.Boolean | raiseEvents | Optional boolean indicating whether or not to raise events. |
Returns
Type | Description |
---|---|
Attempt<OperationStatus> |