Table of Contents

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

logger ILogger<RelationTypeController>
umbracoMapper IUmbracoMapper
relationService IRelationService
shortStringHelper IShortStringHelper

Methods

DeleteById(int)

Deletes a relation type with a given ID.

[HttpPost]
[HttpDelete]
public IActionResult DeleteById(int id)

Parameters

id int

The ID of the relation type to delete.

Returns

IActionResult

A HttpResponseMessage.

GetById(Guid)

Gets a relation type by guid

public ActionResult<RelationTypeDisplay?> GetById(Guid id)

Parameters

id Guid

The 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

id int

The 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

id Udi

The 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

id int
pageNumber int
pageSize int

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

relationType RelationTypeSave

The 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

relationType RelationTypeSave

The relation type to update.

Returns

ActionResult<RelationTypeDisplay>

A display object containing the updated relation type.