Search Results for

    Show / Hide Table of Contents
    View Source

    Class RelationTypeController

    The API controller for editing relation types.

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    BackOfficeNotificationsController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [Authorize(Policy = "TreeAccessRelationTypes")]
    public class RelationTypeController : BackOfficeNotificationsController

    Constructors

    View Source

    RelationTypeController(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 Source

    DeleteById(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 .

    View Source

    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 .

    View Source

    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 .

    View Source

    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 .

    View Source

    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>>
    View Source

    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.

    View Source

    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 containing the persisted relation type's ID.

    View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • RelationTypeController(ILogger<RelationTypeController>, IUmbracoMapper, IRelationService, IShortStringHelper)
    • Methods
      • DeleteById(Int32)
      • GetById(Guid)
      • GetById(Int32)
      • GetById(Udi)
      • GetPagedResults(Int32, Int32, Int32)
      • GetRelationObjectTypes()
      • PostCreate(RelationTypeSave)
      • PostSave(RelationTypeSave)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX