Interface IDictionaryItemService
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IDictionaryItemService
Methods
View SourceCountChildrenAsync(Guid)
Declaration
Task<int> CountChildrenAsync(Guid parentId)
Parameters
Type | Name | Description |
---|---|---|
Guid | parentId |
Returns
Type | Description |
---|---|
Task<System. |
CountRootAsync()
Declaration
Task<int> CountRootAsync()
Returns
Type | Description |
---|---|
Task<System. |
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 |
---|---|---|
IDictionary |
dictionaryItem | IDictionary |
Guid | userKey | Key of the user saving the dictionary item |
Returns
Type | Description |
---|---|
Task<Attempt<IDictionary |
DeleteAsync(Guid, Guid)
Deletes a IDictionary
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> DeleteAsync(Guid id, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The ID of the IDictionary |
Guid | userKey | Key of the user deleting the dictionary item |
Returns
Type | Description |
---|---|
Task<Attempt<IDictionary |
ExistsAsync(String)
Checks if a IDictionary
Declaration
Task<bool> ExistsAsync(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Key of the IDictionary |
Returns
Type | Description |
---|---|
Task<System. |
True if a IDictionary |
GetAsync(Guid)
Gets a IDictionary
Declaration
Task<IDictionaryItem> GetAsync(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | Id of the IDictionary |
Returns
Type | Description |
---|---|
Task<IDictionary |
IDictionary |
GetAsync(String)
Gets a IDictionary
Declaration
Task<IDictionaryItem> GetAsync(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Key of the IDictionary |
Returns
Type | Description |
---|---|
Task<IDictionary |
IDictionary |
GetAtRootAsync()
Gets the root/top IDictionary
Declaration
Task<IEnumerable<IDictionaryItem>> GetAtRootAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<IDictionary |
An enumerable list of IDictionary |
GetChildrenAsync(Guid)
Gets a list of children for a IDictionary
Declaration
Task<IEnumerable<IDictionaryItem>> GetChildrenAsync(Guid parentId)
Parameters
Type | Name | Description |
---|---|---|
Guid | parentId | Id of the parent |
Returns
Type | Description |
---|---|
Task<IEnumerable<IDictionary |
An enumerable list of IDictionary |
GetDescendantsAsync(Nullable<Guid>, String)
Gets a list of descendants for a IDictionary
Declaration
Task<IEnumerable<IDictionaryItem>> GetDescendantsAsync(Guid? parentId, string filter = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
parentId | Id of the parent, null will return all dictionary items |
System. |
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<IDictionary |
An enumerable list of IDictionary |
GetManyAsync(Guid[])
Gets a collection of IDictionary
Declaration
Task<IEnumerable<IDictionaryItem>> GetManyAsync(params Guid[] ids)
Parameters
Type | Name | Description |
---|---|---|
Guid[] | ids | Ids of the IDictionary |
Returns
Type | Description |
---|---|
Task<IEnumerable<IDictionary |
A collection of IDictionary |
GetManyAsync(String[])
Gets a collection of IDictionary
Declaration
Task<IEnumerable<IDictionaryItem>> GetManyAsync(params string[] keys)
Parameters
Type | Name | Description |
---|---|---|
System. |
keys | Keys of the IDictionary |
Returns
Type | Description |
---|---|
Task<IEnumerable<IDictionary |
A collection of IDictionary |
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. |
parentId | |
System. |
skip | |
System. |
take |
Returns
Type | Description |
---|---|
Task<Paged |
MoveAsync(IDictionaryItem, Nullable<Guid>, Guid)
Moves a IDictionary
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> MoveAsync(IDictionaryItem dictionaryItem, Guid? parentId, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
IDictionary |
dictionaryItem | IDictionary |
System. |
parentId | Id of the new IDictionary |
Guid | userKey | Key of the user moving the dictionary item |
Returns
Type | Description |
---|---|
Task<Attempt<IDictionary |
UpdateAsync(IDictionaryItem, Guid)
Updates an existing IDictionary
Declaration
Task<Attempt<IDictionaryItem, DictionaryItemOperationStatus>> UpdateAsync(IDictionaryItem dictionaryItem, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
IDictionary |
dictionaryItem | IDictionary |
Guid | userKey | Key of the user saving the dictionary item |
Returns
Type | Description |
---|---|
Task<Attempt<IDictionary |