public interface IRelationService : IService
Methods View Source
Checks whether two items are related
Declarationbool AreRelated(int parentId, int childId)
Parameters Type Name Description System.Int32 parentId
Id of the Parent relation
System.Int32 childIdId of the Child relation
Returns Type Description System.BooleanReturns True
if any relations exists with the given Ids, otherwise False
Checks whether two items are related
Declarationbool AreRelated(int parentId, int childId, string relationTypeAlias)
Parameters Type Name Description System.Int32 parentId
Id of the Parent relation
System.Int32 childIdId of the Child relation
System.String relationTypeAliasAlias of the type of relation to create
Returns Type Description System.BooleanReturns True
if any relations exist between the entities, otherwise False
Checks whether two items are related
Declarationbool AreRelated(IUmbracoEntity parent, IUmbracoEntity child)
Parameters Returns Type Description System.Boolean
Returns True
if any relations exist between the entities, otherwise False
Checks whether two items are related
Declarationbool AreRelated(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias)
Parameters Type Name Description IUmbracoEntity parent
Parent entity
IUmbracoEntity childChild entity
System.String relationTypeAliasAlias of the type of relation to create
Returns Type Description System.BooleanReturns True
if any relations exist between the entities, otherwise False
Saves a IRelationType
DeclarationTask<Attempt<IRelationType, RelationTypeOperationStatus>> CreateAsync(IRelationType relationType, Guid userKey)
Parameters Type Name Description IRelationType relationType
RelationType to Save
Guid userKeyKey of the user thats saving the relation type
Returns View Source Delete(IRelation)Deletes a IRelation
Declarationvoid Delete(IRelation relation)
Parameters Type Name Description IRelation relation
Relation to Delete
View Source Delete(IRelationType)Deletes a IRelationType
Declarationvoid Delete(IRelationType relationType)
Parameters Type Name Description IRelationType relationType
RelationType to Delete
View Source DeleteAsync(Guid, Guid)Deletes a IRelationType
DeclarationTask<Attempt<IRelationType, RelationTypeOperationStatus>> DeleteAsync(Guid key, Guid userKey)
Parameters Type Name Description Guid key
Key of the relation type to delete
Guid userKeyKey of the user that is deleting the relation type
Returns View Source DeleteRelationsOfType(IRelationType)Deletes all IRelation objects based on the passed in IRelationType
Declarationvoid DeleteRelationsOfType(IRelationType relationType)
Parameters View Source GetAllowedObjectTypes()
Gets all allowed parent/child object types for a given IRelationType />
DeclarationIEnumerable<UmbracoObjectTypes> GetAllowedObjectTypes()
Returns View Source GetAllRelations(Int32[])
Gets all IRelation objects
DeclarationIEnumerable<IRelation> GetAllRelations(params int[] ids)
Parameters Type Name Description System.Int32[] ids
Optional array of integer ids to return relations for
Returns View Source GetAllRelationsByRelationType(Int32)Gets all IRelation objects by their IRelationType's Id
DeclarationIEnumerable<IRelation>? GetAllRelationsByRelationType(int relationTypeId)
Parameters Type Name Description System.Int32 relationTypeId
Id of the IRelationType to retrieve Relations for
Returns Type Description System.Nullable<IEnumerable<IRelation>>An enumerable list of IRelation objects
View Source GetAllRelationsByRelationType(IRelationType)Gets all IRelation objects by their IRelationType
DeclarationIEnumerable<IRelation>? GetAllRelationsByRelationType(IRelationType relationType)
Parameters Returns Type Description System.Nullable<IEnumerable<IRelation>>
An enumerable list of IRelation objects
View Source GetAllRelationTypes(Int32[])Gets all IRelation objects
DeclarationIEnumerable<IRelationType> GetAllRelationTypes(params int[] ids)
Parameters Type Name Description System.Int32[] ids
Optional array of integer ids to return relationtypes for
Returns View Source GetByChild(IUmbracoEntity)Gets a list of IRelation objects by their child Entity
DeclarationIEnumerable<IRelation> GetByChild(IUmbracoEntity child)
Parameters Type Name Description IUmbracoEntity child
Child Entity to retrieve relations for
Returns View Source GetByChild(IUmbracoEntity, String)Gets a list of IRelation objects by their child Entity
DeclarationIEnumerable<IRelation> GetByChild(IUmbracoEntity child, string relationTypeAlias)
Parameters Type Name Description IUmbracoEntity child
Child Entity to retrieve relations for
System.String relationTypeAliasAlias of the type of relation to retrieve
Returns View Source GetByChildId(Int32)Gets a list of IRelation objects by their child Id
DeclarationIEnumerable<IRelation> GetByChildId(int id)
Parameters Type Name Description System.Int32 id
Id of the child to retrieve relations for
Returns View Source GetByChildId(Int32, String)Gets a list of IRelation objects by their child Id
DeclarationIEnumerable<IRelation> GetByChildId(int id, string relationTypeAlias)
Parameters Type Name Description System.Int32 id
Id of the child to retrieve relations for
System.String relationTypeAliasAlias of the type of relation to retrieve
Returns View Source GetById(Int32)Gets a IRelation by its Id
DeclarationIRelation GetById(int id)
Parameters Type Name Description System.Int32 id
Id of the IRelation
Returns View Source GetByParent(IUmbracoEntity)Gets a list of IRelation objects by their parent entity
DeclarationIEnumerable<IRelation>? GetByParent(IUmbracoEntity parent)
Parameters Type Name Description IUmbracoEntity parent
Parent Entity to retrieve relations for
Returns Type Description System.Nullable<IEnumerable<IRelation>>An enumerable list of IRelation objects
View Source GetByParent(IUmbracoEntity, String)Gets a list of IRelation objects by their parent entity
DeclarationIEnumerable<IRelation> GetByParent(IUmbracoEntity parent, string relationTypeAlias)
Parameters Type Name Description IUmbracoEntity parent
Parent Entity to retrieve relations for
System.String relationTypeAliasAlias of the type of relation to retrieve
Returns View Source GetByParentAndChildId(Int32, Int32, IRelationType)Gets a relation by the unique combination of parentId, childId and relationType.
DeclarationIRelation GetByParentAndChildId(int parentId, int childId, IRelationType relationType)
Parameters Type Name Description System.Int32 parentId
The id of the parent item.
System.Int32 childIdThe id of the child item.
IRelationType relationTypeThe RelationType.
Returns Type Description IRelationThe relation or null
View Source GetByParentId(Int32)Gets a list of IRelation objects by their parent Id
DeclarationIEnumerable<IRelation>? GetByParentId(int id)
Parameters Type Name Description System.Int32 id
Id of the parent to retrieve relations for
Returns Type Description System.Nullable<IEnumerable<IRelation>>An enumerable list of IRelation objects
View Source GetByParentId(Int32, String)Gets a list of IRelation objects by their parent Id
DeclarationIEnumerable<IRelation>? GetByParentId(int id, string relationTypeAlias)
Parameters Type Name Description System.Int32 id
Id of the parent to retrieve relations for
System.String relationTypeAliasAlias of the type of relation to retrieve
Returns Type Description System.Nullable<IEnumerable<IRelation>>An enumerable list of IRelation objects
View Source GetByParentOrChildId(Int32)Gets a list of IRelation objects by their child or parent Id. Using this method will get you all relations regards of it being a child or parent relation.
DeclarationIEnumerable<IRelation> GetByParentOrChildId(int id)
Parameters Type Name Description System.Int32 id
Id of the child or parent to retrieve relations for
Returns View Source GetByParentOrChildId(Int32, String) DeclarationIEnumerable<IRelation> GetByParentOrChildId(int id, string relationTypeAlias)
Parameters Type Name Description System.Int32 id System.String relationTypeAlias Returns View Source GetByRelationTypeAlias(String)
Gets a list of IRelation objects by the Alias of the IRelationType
DeclarationIEnumerable<IRelation> GetByRelationTypeAlias(string relationTypeAlias)
Parameters Type Name Description System.String relationTypeAlias
Alias of the IRelationType to retrieve Relations for
Returns View Source GetByRelationTypeId(Int32)Gets a list of IRelation objects by the Id of the IRelationType
DeclarationIEnumerable<IRelation>? GetByRelationTypeId(int relationTypeId)
Parameters Type Name Description System.Int32 relationTypeId
Id of the IRelationType to retrieve Relations for
Returns Type Description System.Nullable<IEnumerable<IRelation>>An enumerable list of IRelation objects
View Source GetByRelationTypeName(String)Gets a list of IRelation objects by the Name of the IRelationType
DeclarationIEnumerable<IRelation> GetByRelationTypeName(string relationTypeName)
Parameters Type Name Description System.String relationTypeName
Name of the IRelationType to retrieve Relations for
Returns View Source GetChildEntitiesFromRelations(IEnumerable<IRelation>)Gets the Child objects from a list of Relations as a list of IUmbracoEntity objects.
DeclarationIEnumerable<IUmbracoEntity> GetChildEntitiesFromRelations(IEnumerable<IRelation> relations)
Parameters Type Name Description IEnumerable<IRelation> relations
List of relations to retrieve child objects from
Returns View Source GetChildEntityFromRelation(IRelation)Gets the Child object from a Relation as an IUmbracoEntity
DeclarationIUmbracoEntity GetChildEntityFromRelation(IRelation relation)
Parameters Type Name Description IRelation relation
Relation to retrieve child object from
Returns View Source GetEntitiesFromRelation(IRelation)Gets the Parent and Child objects from a Relation as a "/> with IUmbracoEntity.
DeclarationTuple<IUmbracoEntity, IUmbracoEntity>? GetEntitiesFromRelation(IRelation relation)
Parameters Type Name Description IRelation relation
Relation to retrieve parent and child object from
Returns View Source GetEntitiesFromRelations(IEnumerable<IRelation>)Gets the Parent and Child objects from a list of Relations as a list of IUmbracoEntity objects.
DeclarationIEnumerable<Tuple<IUmbracoEntity, IUmbracoEntity>> GetEntitiesFromRelations(IEnumerable<IRelation> relations)
Parameters Type Name Description IEnumerable<IRelation> relations
List of relations to retrieve parent and child objects from
Returns View Source GetPagedByChildKeyAsync(Guid, Int32, Int32, String) DeclarationTask<PagedModel<IRelation>> GetPagedByChildKeyAsync(Guid childKey, int skip, int take, string relationTypeAlias)
Parameters Type Name Description Guid childKey System.Int32 skip System.Int32 take System.String relationTypeAlias Returns View Source GetPagedByRelationTypeId(Int32, Int64, Int32, out Int64, Ordering)
Gets a paged result of IRelation
DeclarationIEnumerable<IRelation> GetPagedByRelationTypeId(int relationTypeId, long pageIndex, int pageSize, out long totalRecords, Ordering ordering = null)
Parameters Type Name Description System.Int32 relationTypeId System.Int64 pageIndex System.Int32 pageSize System.Int64 totalRecords Ordering ordering Returns View Source GetPagedByRelationTypeKeyAsync(Guid, Int32, Int32, Ordering)
Gets a paged result of IRelation
DeclarationTask<Attempt<PagedModel<IRelation>, RelationOperationStatus>> GetPagedByRelationTypeKeyAsync(Guid key, int skip, int take, Ordering ordering = null)
Parameters Type Name Description Guid key System.Int32 skip System.Int32 take Ordering ordering Returns View Source GetPagedChildEntitiesByParentId(Int32, Int64, Int32, out Int64, UmbracoObjectTypes[])
Returns paged child entities for a related parent id
DeclarationIEnumerable<IUmbracoEntity> GetPagedChildEntitiesByParentId(int id, long pageIndex, int pageSize, out long totalChildren, params UmbracoObjectTypes[] entityTypes)
Parameters Type Name Description System.Int32 id System.Int64 pageIndex System.Int32 pageSize System.Int64 totalChildren UmbracoObjectTypes[] entityTypes Returns View Source GetPagedParentEntitiesByChildId(Int32, Int64, Int32, out Int64, UmbracoObjectTypes[])
Returns paged parent entities for a related child id
DeclarationIEnumerable<IUmbracoEntity> GetPagedParentEntitiesByChildId(int id, long pageIndex, int pageSize, out long totalChildren, params UmbracoObjectTypes[] entityTypes)
Parameters Type Name Description System.Int32 id System.Int64 pageIndex System.Int32 pageSize System.Int64 totalChildren UmbracoObjectTypes[] entityTypes Returns View Source GetPagedRelationTypesAsync(Int32, Int32, Int32[])
Gets the Relation types in a paged manner. Currently implements the paging in memory on the name attribute because the underlying repository does not support paging yet
DeclarationTask<PagedModel<IRelationType>> GetPagedRelationTypesAsync(int skip, int take, params int[] ids)
Parameters Type Name Description System.Int32 skip System.Int32 take System.Int32[] ids Returns View Source GetParentEntitiesFromRelations(IEnumerable<IRelation>)
Gets the Parent objects from a list of Relations as a list of IUmbracoEntity objects.
DeclarationIEnumerable<IUmbracoEntity> GetParentEntitiesFromRelations(IEnumerable<IRelation> relations)
Parameters Type Name Description IEnumerable<IRelation> relations
List of relations to retrieve parent objects from
Returns View Source GetParentEntityFromRelation(IRelation)Gets the Parent object from a Relation as an IUmbracoEntity
DeclarationIUmbracoEntity GetParentEntityFromRelation(IRelation relation)
Parameters Type Name Description IRelation relation
Relation to retrieve parent object from
Returns View Source GetRelationTypeByAlias(String)Gets a IRelationType by its Alias
DeclarationIRelationType GetRelationTypeByAlias(string alias)
Parameters Type Name Description System.String alias
Alias of the IRelationType
Returns View Source GetRelationTypeById(Guid)Gets a IRelationType by its Id
DeclarationIRelationType GetRelationTypeById(Guid id)
Parameters Returns View Source GetRelationTypeById(Int32)
Gets a IRelationType by its Id
DeclarationIRelationType GetRelationTypeById(int id)
Parameters Returns View Source HasRelations(IRelationType)
Checks whether any relations exists for the passed in IRelationType.
Declarationbool HasRelations(IRelationType relationType)
Parameters Returns Type Description System.Boolean
Returns True
if any relations exists for the given IRelationType, otherwise False
Checks whether any relations exists for the passed in Id.
Declaration Parameters Type Name Description System.Int32 idId of an object to check relations for
Returns Type Description System.BooleanReturns True
if any relations exists with the given Id, otherwise False
Checks whether any relations exists for the passed in Id and direction.
Declarationvirtual bool IsRelated(int id, RelationDirectionFilter directionFilter)
Parameters Type Name Description System.Int32 id
Id of an object to check relations for
RelationDirectionFilter directionFilterIndicates whether to check for relations as parent, child or in either direction.
Returns Type Description System.BooleanReturns True
if any relations exists with the given Id, otherwise False
Relates two objects by their entity Ids.
DeclarationIRelation Relate(int parentId, int childId, string relationTypeAlias)
Parameters Type Name Description System.Int32 parentId
Id of the parent
System.Int32 childIdId of the child
System.String relationTypeAliasAlias of the type of relation to create
Returns View Source Relate(Int32, Int32, IRelationType)Relates two objects by their entity Ids.
DeclarationIRelation Relate(int parentId, int childId, IRelationType relationType)
Parameters Type Name Description System.Int32 parentId
Id of the parent
System.Int32 childIdId of the child
IRelationType relationTypeThe type of relation to create
Returns View Source Relate(IUmbracoEntity, IUmbracoEntity, String)Relates two objects that are based on the IUmbracoEntity interface.
DeclarationIRelation Relate(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias)
Parameters Type Name Description IUmbracoEntity parent
Parent entity
IUmbracoEntity childChild entity
System.String relationTypeAliasAlias of the type of relation to create
Returns View Source Relate(IUmbracoEntity, IUmbracoEntity, IRelationType)Relates two objects that are based on the IUmbracoEntity interface.
DeclarationIRelation Relate(IUmbracoEntity parent, IUmbracoEntity child, IRelationType relationType)
Parameters Returns View Source Save(IEnumerable<IRelation>) Declaration
void Save(IEnumerable<IRelation> relations)
Parameters Type Name Description IEnumerable<IRelation> relations View Source Save(IRelation)
Saves a IRelation
Declarationvoid Save(IRelation relation)
Parameters Type Name Description IRelation relation
Relation to save
View Source Save(IRelationType)Saves a IRelationType
Declarationvoid Save(IRelationType relationType)
Parameters Type Name Description IRelationType relationType
RelationType to Save
View Source UpdateAsync(IRelationType, Guid)Saves a IRelationType
DeclarationTask<Attempt<IRelationType, RelationTypeOperationStatus>> UpdateAsync(IRelationType relationType, Guid userKey)
Parameters Type Name Description IRelationType relationType
RelationType to Save
Guid userKeyKey of the user thats saving the relation type
ReturnsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4