Class RelationTypeController
The API controller for editing relation types.
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Namespace: Umbraco.Cms.Web.BackOffice.Controllers
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[Authorize(Policy = "TreeAccessRelationTypes")]
public class RelationTypeController : BackOfficeNotificationsController
Constructors
View SourceRelationTypeController(ILogger<RelationTypeController>, IUmbracoMapper, IRelationService, IShortStringHelper)
Declaration
public RelationTypeController(ILogger<RelationTypeController> logger, IUmbracoMapper umbracoMapper, IRelationService relationService, IShortStringHelper shortStringHelper)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
logger | |
IUmbraco |
umbracoMapper | |
IRelation |
relationService | |
IShort |
shortStringHelper |
Methods
View SourceDeleteById(Int32)
Deletes a relation type with a given ID.
Declaration
[HttpPost]
[HttpDelete]
public IActionResult DeleteById(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The ID of the relation type to delete. |
Returns
Type | Description |
---|---|
Microsoft. |
A |
GetById(Guid)
Gets a relation type by guid
Declaration
public ActionResult<RelationTypeDisplay?> GetById(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The relation type ID. |
Returns
Type | Description |
---|---|
Microsoft. |
Returns the |
GetById(Int32)
Gets a relation type by id
Declaration
public ActionResult<RelationTypeDisplay?> GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The relation type ID. |
Returns
Type | Description |
---|---|
Microsoft. |
Returns the |
GetById(Udi)
Gets a relation type by udi
Declaration
public ActionResult<RelationTypeDisplay?> GetById(Udi id)
Parameters
Type | Name | Description |
---|---|---|
Udi | id | The relation type ID. |
Returns
Type | Description |
---|---|
Microsoft. |
Returns the |
GetPagedResults(Int32, Int32, Int32)
Declaration
public PagedResult<RelationDisplay?> GetPagedResults(int id, int pageNumber = 1, int pageSize = 100)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | |
System. |
pageNumber | |
System. |
pageSize |
Returns
Type | Description |
---|---|
Paged |
GetRelationObjectTypes()
Gets a list of object types which can be associated via relations.
Declaration
public List<ObjectType> GetRelationObjectTypes()
Returns
Type | Description |
---|---|
List<Object |
A list of available object types. |
PostCreate(RelationTypeSave)
Creates a new relation type.
Declaration
public ActionResult<int> PostCreate(RelationTypeSave relationType)
Parameters
Type | Name | Description |
---|---|---|
Relation |
relationType | The relation type to create. |
Returns
Type | Description |
---|---|
Microsoft. |
A |
PostSave(RelationTypeSave)
Updates an existing relation type.
Declaration
public ActionResult<RelationTypeDisplay?> PostSave(RelationTypeSave relationType)
Parameters
Type | Name | Description |
---|---|---|
Relation |
relationType | The relation type to update. |
Returns
Type | Description |
---|---|
Microsoft. |
A display object containing the updated relation type. |