Class RelationTypeController
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
The API controller for editing relation types.
[Authorize(Policy = "TreeAccessRelationTypes")]
public class RelationTypeController : BackOfficeNotificationsController
- Inheritance
-
RelationTypeController
- Inherited Members
Constructors
RelationTypeController(ILogger<RelationTypeController>, IUmbracoMapper, IRelationService, IShortStringHelper)
public RelationTypeController(ILogger<RelationTypeController> logger, IUmbracoMapper umbracoMapper, IRelationService relationService, IShortStringHelper shortStringHelper)
Parameters
loggerILogger<RelationTypeController>umbracoMapperIUmbracoMapperrelationServiceIRelationServiceshortStringHelperIShortStringHelper
Methods
DeleteById(int)
Deletes a relation type with a given ID.
[HttpPost]
[HttpDelete]
public IActionResult DeleteById(int id)
Parameters
idintThe ID of the relation type to delete.
Returns
GetById(Guid)
Gets a relation type by guid
public ActionResult<RelationTypeDisplay?> GetById(Guid id)
Parameters
idGuidThe relation type ID.
Returns
- ActionResult<RelationTypeDisplay>
Returns the Umbraco.Cms.Core.Models.ContentEditing.RelationTypeDisplay.
GetById(int)
Gets a relation type by id
public ActionResult<RelationTypeDisplay?> GetById(int id)
Parameters
idintThe relation type ID.
Returns
- ActionResult<RelationTypeDisplay>
Returns the Umbraco.Cms.Core.Models.ContentEditing.RelationTypeDisplay.
GetById(Udi)
Gets a relation type by udi
public ActionResult<RelationTypeDisplay?> GetById(Udi id)
Parameters
idUdiThe relation type ID.
Returns
- ActionResult<RelationTypeDisplay>
Returns the Umbraco.Cms.Core.Models.ContentEditing.RelationTypeDisplay.
GetPagedResults(int, int, int)
public PagedResult<RelationDisplay?> GetPagedResults(int id, int pageNumber = 1, int pageSize = 100)
Parameters
Returns
- PagedResult<RelationDisplay>
GetRelationObjectTypes()
Gets a list of object types which can be associated via relations.
public List<ObjectType> GetRelationObjectTypes()
Returns
- List<ObjectType>
A list of available object types.
PostCreate(RelationTypeSave)
Creates a new relation type.
public ActionResult<int> PostCreate(RelationTypeSave relationType)
Parameters
relationTypeRelationTypeSaveThe relation type to create.
Returns
- ActionResult<int>
A HttpResponseMessage containing the persisted relation type's ID.
PostSave(RelationTypeSave)
Updates an existing relation type.
public ActionResult<RelationTypeDisplay?> PostSave(RelationTypeSave relationType)
Parameters
relationTypeRelationTypeSaveThe relation type to update.
Returns
- ActionResult<RelationTypeDisplay>
A display object containing the updated relation type.