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
[PluginController("UmbracoApi")]
[Authorize(Policy = "TreeAccessRelationTypes")]
public class RelationTypeController : BackOfficeNotificationsController, IUmbracoFeature, IDiscoverable
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.Extensions.Logging.ILogger<RelationTypeController> | logger | |
IUmbracoMapper | umbracoMapper | |
IRelationService | relationService | |
IShortStringHelper | 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.Int32 | id | The ID of the relation type to delete. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.IActionResult | 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.AspNetCore.Mvc.ActionResult<RelationTypeDisplay> | Returns the RelationTypeDisplay. |
GetById(Int32)
Gets a relation type by id
Declaration
public ActionResult<RelationTypeDisplay> GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The relation type ID. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.ActionResult<RelationTypeDisplay> | Returns the RelationTypeDisplay. |
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.AspNetCore.Mvc.ActionResult<RelationTypeDisplay> | Returns the RelationTypeDisplay. |
GetPagedResults(Int32, Int32, Int32)
Declaration
public PagedResult<RelationDisplay> GetPagedResults(int id, int pageNumber = 1, int pageSize = 100)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | |
System.Int32 | pageNumber | |
System.Int32 | pageSize |
Returns
Type | Description |
---|---|
PagedResult<RelationDisplay> |
GetRelationObjectTypes()
Gets a list of object types which can be associated via relations.
Declaration
public List<ObjectType> GetRelationObjectTypes()
Returns
Type | Description |
---|---|
List<ObjectType> | A list of available object types. |
PostCreate(RelationTypeSave)
Creates a new relation type.
Declaration
public ActionResult<int> PostCreate(RelationTypeSave relationType)
Parameters
Type | Name | Description |
---|---|---|
RelationTypeSave | relationType | The relation type to create. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.ActionResult<System.Int32> | A |
PostSave(RelationTypeSave)
Updates an existing relation type.
Declaration
public ActionResult<RelationTypeDisplay> PostSave(RelationTypeSave relationType)
Parameters
Type | Name | Description |
---|---|---|
RelationTypeSave | relationType | The relation type to update. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.ActionResult<RelationTypeDisplay> | A display object containing the updated relation type. |