Interface IDictionaryRepository
Represents a repository for IDictionaryItem entities.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IDictionaryRepository : IReadWriteQueryRepository<int, IDictionaryItem>, IReadRepository<int, IDictionaryItem>, IWriteRepository<IDictionaryItem>, IQueryRepository<IDictionaryItem>, IRepository
Methods
View SourceGet(Guid)
Gets a dictionary item by its unique identifier.
Declaration
IDictionaryItem? Get(Guid uniqueId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | uniqueId | The unique identifier of the dictionary item. |
Returns
| Type | Description |
|---|---|
| IDictionaryItem | The dictionary item if found; otherwise, |
Get(string)
Gets a dictionary item by its key.
Declaration
IDictionaryItem? Get(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the dictionary item. |
Returns
| Type | Description |
|---|---|
| IDictionaryItem | The dictionary item if found; otherwise, |
GetDictionaryItemDescendants(Guid?, string?)
Gets all descendant dictionary items of a parent item.
Declaration
IEnumerable<IDictionaryItem> GetDictionaryItemDescendants(Guid? parentId, string? filter = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid? | parentId | The unique identifier of the parent item, or |
| string | filter | An optional filter to apply to the results. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IDictionaryItem> | A collection of descendant dictionary items. |
GetDictionaryItemKeyMap()
Gets a mapping of dictionary item keys to their unique identifiers.
Declaration
Dictionary<string, Guid> GetDictionaryItemKeyMap()
Returns
| Type | Description |
|---|---|
| Dictionary<string, Guid> | A dictionary mapping keys to unique identifiers. |
GetMany(params Guid[])
Gets multiple dictionary items by their unique identifiers.
Declaration
IEnumerable<IDictionaryItem> GetMany(params Guid[] uniqueIds)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid[] | uniqueIds | The unique identifiers of the dictionary items. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IDictionaryItem> | A collection of dictionary items. |
GetManyByKeys(params string[])
Gets multiple dictionary items by their keys.
Declaration
IEnumerable<IDictionaryItem> GetManyByKeys(params string[] keys)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | keys | The keys of the dictionary items. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IDictionaryItem> | A collection of dictionary items. |