Class DictionaryController
The API controller used for editing dictionary items
Inheritance
Namespace: Umbraco.Cms.Web.BackOffice.Controllers
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[PluginController(null)]
[Authorize(Policy = "TreeAccessDictionary")]
public class DictionaryController : BackOfficeNotificationsController, IUmbracoFeature, IDiscoverable
Remarks
The security for this controller is defined to allow full CRUD access to dictionary if the user has access to either: Dictionary
Constructors
View SourceDictionaryController(ILogger<DictionaryController>, ILocalizationService, IBackOfficeSecurityAccessor, IOptions<GlobalSettings>, ILocalizedTextService, IUmbracoMapper)
Declaration
public DictionaryController(ILogger<DictionaryController> logger, ILocalizationService localizationService, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IOptions<GlobalSettings> globalSettings, ILocalizedTextService localizedTextService, IUmbracoMapper umbracoMapper)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
logger | |
ILocalization |
localizationService | |
IBack |
backofficeSecurityAccessor | |
Microsoft. |
globalSettings | |
ILocalized |
localizedTextService | |
IUmbraco |
umbracoMapper |
Methods
View SourceCreate(Int32, String)
Creates a new dictionary item
Declaration
[HttpPost]
public ActionResult<int> Create(int parentId, string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
parentId | The parent id. |
System. |
key | The key. |
Returns
Type | Description |
---|---|
Microsoft. |
The System. |
DeleteById(Int32)
Deletes a data type with a given ID
Declaration
[HttpDelete]
[HttpPost]
public IActionResult DeleteById(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id |
Returns
Type | Description |
---|---|
Microsoft. |
System. |
GetById(Guid)
Gets a dictionary item by guid
Declaration
public ActionResult<DictionaryDisplay> GetById(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
Returns
Type | Description |
---|---|
Microsoft. |
The Dictionary |
GetById(Int32)
Gets a dictionary item by id
Declaration
public ActionResult<DictionaryDisplay> GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
Returns
Type | Description |
---|---|
Microsoft. |
The Dictionary |
GetById(Udi)
Gets a dictionary item by udi
Declaration
public ActionResult<DictionaryDisplay> GetById(Udi id)
Parameters
Type | Name | Description |
---|---|---|
Udi | id | The id. |
Returns
Type | Description |
---|---|
Microsoft. |
The Dictionary |
GetList()
Retrieves a list with all dictionary items
Declaration
public IEnumerable<DictionaryOverviewDisplay> GetList()
Returns
Type | Description |
---|---|
System. |
The System.Collections.Generic.IEnumerable<T>. |
PostMove(MoveOrCopy)
Changes the structure for dictionary items
Declaration
public IActionResult PostMove(MoveOrCopy move)
Parameters
Type | Name | Description |
---|---|---|
Move |
move |
Returns
Type | Description |
---|---|
Microsoft. |
PostSave(DictionarySave)
Saves a dictionary item
Declaration
public ActionResult<DictionaryDisplay> PostSave(DictionarySave dictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary |
dictionary | The dictionary. |
Returns
Type | Description |
---|---|
Microsoft. |
The Dictionary |