Interface IDictionaryItemService
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IDictionaryItemServiceMethods
View SourceCountChildrenAsync(Guid)
Declaration
Task<int> CountChildrenAsync(Guid parentId)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | parentId | 
Returns
| Type | Description | 
|---|---|
| Task<System.Int32> | 
CountRootAsync()
Declaration
Task<int> CountRootAsync()Returns
| Type | Description | 
|---|---|
| Task<System.Int32> | 
CreateAsync(IDictionaryItem, Guid)
Creates and saves a new dictionary item and assigns translations to all applicable languages if specified
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> CreateAsync(IDictionaryItem dictionaryItem, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| IDictionaryItem | dictionaryItem | IDictionaryItem to create | 
| Guid | userKey | Key of the user saving the dictionary item | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> | 
DeleteAsync(Guid, Guid)
Deletes a IDictionaryItem object and its related translations as well as its children.
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> DeleteAsync(Guid id, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | id | The ID of the IDictionaryItem to delete | 
| Guid | userKey | Key of the user deleting the dictionary item | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> | 
ExistsAsync(String)
Checks if a IDictionaryItem with given key exists
Declaration
Task<bool> ExistsAsync(string key)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | key | Key of the IDictionaryItem | 
Returns
| Type | Description | 
|---|---|
| Task<System.Boolean> | True if a IDictionaryItem exists, otherwise false | 
GetAsync(Guid)
Gets a IDictionaryItem by its 
Declaration
Task<IDictionaryItem> GetAsync(Guid id)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | id | Id of the IDictionaryItem | 
Returns
| Type | Description | 
|---|---|
| Task<IDictionaryItem> | IDictionaryItem | 
GetAsync(String)
Gets a IDictionaryItem by by its key
Declaration
Task<IDictionaryItem> GetAsync(string key)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | key | Key of the IDictionaryItem | 
Returns
| Type | Description | 
|---|---|
| Task<IDictionaryItem> | IDictionaryItem | 
GetAtRootAsync()
Gets the root/top IDictionaryItem objects
Declaration
Task<IEnumerable<IDictionaryItem>> GetAtRootAsync()Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<IDictionaryItem>> | An enumerable list of IDictionaryItem objects | 
GetChildrenAsync(Guid)
Gets a list of children for a IDictionaryItem
Declaration
Task<IEnumerable<IDictionaryItem>> GetChildrenAsync(Guid parentId)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | parentId | Id of the parent | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<IDictionaryItem>> | An enumerable list of IDictionaryItem objects | 
GetDescendantsAsync(Nullable<Guid>, String)
Gets a list of descendants for a IDictionaryItem
Declaration
Task<IEnumerable<IDictionaryItem>> GetDescendantsAsync(Guid? parentId, string filter = null)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Nullable<Guid> | parentId | Id of the parent, null will return all dictionary items | 
| System.String | filter | An optional filter, which will limit the results to only those dictionary items whose key starts with the filter value. | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<IDictionaryItem>> | An enumerable list of IDictionaryItem objects | 
GetManyAsync(Guid[])
Gets a collection of IDictionaryItem by their 
Declaration
Task<IEnumerable<IDictionaryItem>> GetManyAsync(params Guid[] ids)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid[] | ids | Ids of the IDictionaryItem | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<IDictionaryItem>> | A collection of IDictionaryItem | 
GetManyAsync(String[])
Gets a collection of IDictionaryItem by their keys
Declaration
Task<IEnumerable<IDictionaryItem>> GetManyAsync(params string[] keys)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String[] | keys | Keys of the IDictionaryItem | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<IDictionaryItem>> | A collection of IDictionaryItem | 
GetPagedAsync(Nullable<Guid>, Int32, Int32)
Gets the dictionary items in a paged manner. Currently implements the paging in memory on the itenkey property because the underlying repository does not support paging yet
Declaration
Task<PagedModel<IDictionaryItem>> GetPagedAsync(Guid? parentId, int skip, int take)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Nullable<Guid> | parentId | |
| System.Int32 | skip | |
| System.Int32 | take | 
Returns
| Type | Description | 
|---|---|
| Task<PagedModel<IDictionaryItem>> | 
MoveAsync(IDictionaryItem, Nullable<Guid>, Guid)
Moves a IDictionaryItem object
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> MoveAsync(IDictionaryItem dictionaryItem, Guid? parentId, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| IDictionaryItem | dictionaryItem | IDictionaryItem to move | 
| System.Nullable<Guid> | parentId | Id of the new IDictionaryItem parent, null if the item should be moved to the root | 
| Guid | userKey | Key of the user moving the dictionary item | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> | 
UpdateAsync(IDictionaryItem, Guid)
Updates an existing IDictionaryItem object
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> UpdateAsync(IDictionaryItem dictionaryItem, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| IDictionaryItem | dictionaryItem | IDictionaryItem to update | 
| Guid | userKey | Key of the user saving the dictionary item | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> |