Class RelationTypeController
The API controller for editing relation types.
Inheritance
System.Object
Namespace: Umbraco.Web.Editors
Assembly: Umbraco.Web.dll
Syntax
[PluginController("UmbracoApi")]
public class RelationTypeController : BackOfficeNotificationsController, IDiscoverable
Constructors
View SourceRelationTypeController(IGlobalSettings, IUmbracoContextAccessor, ISqlContext, ServiceContext, AppCaches, IProfilingLogger, IRuntimeState, UmbracoHelper)
Declaration
public RelationTypeController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
Parameters
Type | Name | Description |
---|---|---|
IGlobalSettings | globalSettings | |
IUmbracoContextAccessor | umbracoContextAccessor | |
ISqlContext | sqlContext | |
ServiceContext | services | |
AppCaches | appCaches | |
IProfilingLogger | logger | |
IRuntimeState | runtimeState | |
UmbracoHelper | umbracoHelper |
Methods
View SourceDeleteById(Int32)
Deletes a relation type with a given ID.
Declaration
public HttpResponseMessage DeleteById(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The ID of the relation type to delete. |
Returns
Type | Description |
---|---|
HttpResponseMessage | A |
GetById(Guid)
Gets a relation type by guid
Declaration
public RelationTypeDisplay GetById(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The relation type ID. |
Returns
Type | Description |
---|---|
RelationTypeDisplay | Returns the RelationTypeDisplay. |
GetById(Int32)
Gets a relation type by id
Declaration
public RelationTypeDisplay GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The relation type ID. |
Returns
Type | Description |
---|---|
RelationTypeDisplay | Returns the RelationTypeDisplay. |
GetById(Udi)
Gets a relation type by udi
Declaration
public RelationTypeDisplay GetById(Udi id)
Parameters
Type | Name | Description |
---|---|---|
Udi | id | The relation type ID. |
Returns
Type | Description |
---|---|
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 |
---|---|
System.Collections.Generic.List<ObjectType> | A list of available object types. |
PostCreate(RelationTypeSave)
Creates a new relation type.
Declaration
public HttpResponseMessage PostCreate(RelationTypeSave relationType)
Parameters
Type | Name | Description |
---|---|---|
RelationTypeSave | relationType | The relation type to create. |
Returns
Type | Description |
---|---|
HttpResponseMessage | A |
PostSave(RelationTypeSave)
Updates an existing relation type.
Declaration
public RelationTypeDisplay PostSave(RelationTypeSave relationType)
Parameters
Type | Name | Description |
---|---|---|
RelationTypeSave | relationType | The relation type to update. |
Returns
Type | Description |
---|---|
RelationTypeDisplay | A display object containing the updated relation type. |