Interface IScriptService
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IScriptService : IBasicFileService<IScript>
Methods
View SourceCreateAsync(ScriptCreateModel, Guid)
Creates a new script.
Declaration
Task<Attempt<IScript, ScriptOperationStatus>> CreateAsync(ScriptCreateModel createModel, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
ScriptCreateModel | createModel | ScriptCreateModel containing the information about the script being created. |
Guid | userKey | The key of the user performing the operation. |
Returns
Type | Description |
---|---|
Task<Attempt<IScript, ScriptOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed ScriptOperationStatus. |
DeleteAsync(String, Guid)
Deletes a Script.
Declaration
Task<ScriptOperationStatus> DeleteAsync(string path, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path of the script to delete. |
Guid | userKey | The key of the user performing the operation. |
Returns
Type | Description |
---|---|
Task<ScriptOperationStatus> | An operation status. |
RenameAsync(String, ScriptRenameModel, Guid)
Renames a script.
Declaration
Task<Attempt<IScript, ScriptOperationStatus>> RenameAsync(string path, ScriptRenameModel renameModel, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path of the script to rename. |
ScriptRenameModel | renameModel | A ScriptRenameModel with the changes. |
Guid | userKey | The key of the user performing the operation. |
Returns
Type | Description |
---|---|
Task<Attempt<IScript, ScriptOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed ScriptOperationStatus. |
UpdateAsync(String, ScriptUpdateModel, Guid)
Updates an existing script.
Declaration
Task<Attempt<IScript, ScriptOperationStatus>> UpdateAsync(string path, ScriptUpdateModel updateModel, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path of the script to update. |
ScriptUpdateModel | updateModel | A ScriptUpdateModel with the changes. |
Guid | userKey | The key of the user performing the operation. |
Returns
Type | Description |
---|---|
Task<Attempt<IScript, ScriptOperationStatus>> | An attempt indicating if the operation was a success as well as a more detailed ScriptOperationStatus. |