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.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<System.Nullable<RelationTypeDisplay>> | Returns the   | 
      
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<System.Nullable<RelationTypeDisplay>> | 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.AspNetCore.Mvc.ActionResult<System.Nullable<RelationTypeDisplay>> | Returns the   | 
      
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<System.Nullable<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<System.Nullable<RelationTypeDisplay>> | A display object containing the updated relation type.  |