Class RelationService
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public class RelationService : RepositoryService
Constructors
RelationService(IScopeProvider, ILoggerFactory, IEventMessagesFactory, IEntityService, IRelationRepository, IRelationTypeRepository, IAuditRepository)
Declaration
public RelationService(IScopeProvider uowProvider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IEntityService entityService, IRelationRepository relationRepository, IRelationTypeRepository relationTypeRepository, IAuditRepository auditRepository)
Parameters
Type |
Name |
Description |
IScopeProvider |
uowProvider |
|
ILoggerFactory |
loggerFactory |
|
IEventMessagesFactory |
eventMessagesFactory |
|
IEntityService |
entityService |
|
IRelationRepository |
relationRepository |
|
IRelationTypeRepository |
relationTypeRepository |
|
IAuditRepository |
auditRepository |
|
Methods
Declaration
public bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
parent |
|
IUmbracoEntity |
child |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
parent |
|
IUmbracoEntity |
child |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool AreRelated(int parentId, int childId)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
childId |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool AreRelated(int parentId, int childId, IRelationType relationType)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
childId |
|
IRelationType |
relationType |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool AreRelated(int parentId, int childId, string relationTypeAlias)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
childId |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Boolean |
|
Delete(IRelation)
Declaration
public void Delete(IRelation relation)
Parameters
Type |
Name |
Description |
IRelation |
relation |
|
Delete(IRelationType)
Declaration
public void Delete(IRelationType relationType)
Parameters
Type |
Name |
Description |
IRelationType |
relationType |
|
DeleteRelationsOfType(IRelationType)
Declaration
public void DeleteRelationsOfType(IRelationType relationType)
Parameters
Type |
Name |
Description |
IRelationType |
relationType |
|
GetAllRelations(Int32[])
Declaration
public IEnumerable<IRelation> GetAllRelations(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetAllRelationsByRelationType(IRelationType)
Declaration
public IEnumerable<IRelation> GetAllRelationsByRelationType(IRelationType relationType)
Parameters
Type |
Name |
Description |
IRelationType |
relationType |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetAllRelationsByRelationType(Int32)
Declaration
public IEnumerable<IRelation> GetAllRelationsByRelationType(int relationTypeId)
Parameters
Type |
Name |
Description |
System.Int32 |
relationTypeId |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetAllRelationTypes(Int32[])
Declaration
public IEnumerable<IRelationType> GetAllRelationTypes(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelationType> |
|
GetByChild(IUmbracoEntity)
Declaration
public IEnumerable<IRelation> GetByChild(IUmbracoEntity child)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
child |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByChild(IUmbracoEntity, String)
Declaration
public IEnumerable<IRelation> GetByChild(IUmbracoEntity child, string relationTypeAlias)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
child |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByChildId(Int32)
Declaration
public IEnumerable<IRelation> GetByChildId(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByChildId(Int32, String)
Declaration
public IEnumerable<IRelation> GetByChildId(int id, string relationTypeAlias)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetById(Int32)
Declaration
public IRelation GetById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
IRelation |
|
GetByParent(IUmbracoEntity)
Declaration
public IEnumerable<IRelation> GetByParent(IUmbracoEntity parent)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
parent |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByParent(IUmbracoEntity, String)
Declaration
public IEnumerable<IRelation> GetByParent(IUmbracoEntity parent, string relationTypeAlias)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
parent |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByParentAndChildId(Int32, Int32, IRelationType)
Declaration
public IRelation GetByParentAndChildId(int parentId, int childId, IRelationType relationType)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
childId |
|
IRelationType |
relationType |
|
Returns
Type |
Description |
IRelation |
|
GetByParentId(Int32)
Declaration
public IEnumerable<IRelation> GetByParentId(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByParentId(Int32, String)
Declaration
public IEnumerable<IRelation> GetByParentId(int id, string relationTypeAlias)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByParentOrChildId(Int32)
Declaration
public IEnumerable<IRelation> GetByParentOrChildId(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByParentOrChildId(Int32, String)
Declaration
public IEnumerable<IRelation> GetByParentOrChildId(int id, string relationTypeAlias)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByRelationTypeAlias(String)
Declaration
public IEnumerable<IRelation> GetByRelationTypeAlias(string relationTypeAlias)
Parameters
Type |
Name |
Description |
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByRelationTypeId(Int32)
Declaration
public IEnumerable<IRelation> GetByRelationTypeId(int relationTypeId)
Parameters
Type |
Name |
Description |
System.Int32 |
relationTypeId |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetByRelationTypeName(String)
Declaration
public IEnumerable<IRelation> GetByRelationTypeName(string relationTypeName)
Parameters
Type |
Name |
Description |
System.String |
relationTypeName |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetChildEntitiesFromRelations(IEnumerable<IRelation>)
Declaration
public IEnumerable<IUmbracoEntity> GetChildEntitiesFromRelations(IEnumerable<IRelation> relations)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
relations |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IUmbracoEntity> |
|
GetChildEntityFromRelation(IRelation)
Declaration
public IUmbracoEntity GetChildEntityFromRelation(IRelation relation)
Parameters
Type |
Name |
Description |
IRelation |
relation |
|
Returns
Type |
Description |
IUmbracoEntity |
|
GetEntitiesFromRelation(IRelation)
Declaration
public Tuple<IUmbracoEntity, IUmbracoEntity> GetEntitiesFromRelation(IRelation relation)
Parameters
Type |
Name |
Description |
IRelation |
relation |
|
Returns
Type |
Description |
System.Tuple<IUmbracoEntity, IUmbracoEntity> |
|
GetEntitiesFromRelations(IEnumerable<IRelation>)
Declaration
public IEnumerable<Tuple<IUmbracoEntity, IUmbracoEntity>> GetEntitiesFromRelations(IEnumerable<IRelation> relations)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
relations |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Tuple<IUmbracoEntity, IUmbracoEntity>> |
|
GetPagedByRelationTypeId(Int32, Int64, Int32, out Int64, Ordering)
Declaration
public IEnumerable<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
Type |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
|
GetPagedChildEntitiesByParentId(Int32, Int64, Int32, out Int64, UmbracoObjectTypes[])
Declaration
public IEnumerable<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
Type |
Description |
System.Collections.Generic.IEnumerable<IUmbracoEntity> |
|
GetPagedParentEntitiesByChildId(Int32, Int64, Int32, out Int64, UmbracoObjectTypes[])
Declaration
public IEnumerable<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
Type |
Description |
System.Collections.Generic.IEnumerable<IUmbracoEntity> |
|
GetParentEntitiesFromRelations(IEnumerable<IRelation>)
Declaration
public IEnumerable<IUmbracoEntity> GetParentEntitiesFromRelations(IEnumerable<IRelation> relations)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
relations |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IUmbracoEntity> |
|
GetParentEntityFromRelation(IRelation)
Declaration
public IUmbracoEntity GetParentEntityFromRelation(IRelation relation)
Parameters
Type |
Name |
Description |
IRelation |
relation |
|
Returns
Type |
Description |
IUmbracoEntity |
|
GetRelationTypeByAlias(String)
Declaration
public IRelationType GetRelationTypeByAlias(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
Returns
Type |
Description |
IRelationType |
|
GetRelationTypeById(Guid)
Declaration
public IRelationType GetRelationTypeById(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
|
Returns
Type |
Description |
IRelationType |
|
GetRelationTypeById(Int32)
Declaration
public IRelationType GetRelationTypeById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
IRelationType |
|
HasRelations(IRelationType)
Declaration
public bool HasRelations(IRelationType relationType)
Parameters
Type |
Name |
Description |
IRelationType |
relationType |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool IsRelated(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Boolean |
|
Relate(IUmbracoEntity, IUmbracoEntity, IRelationType)
Declaration
public IRelation Relate(IUmbracoEntity parent, IUmbracoEntity child, IRelationType relationType)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
parent |
|
IUmbracoEntity |
child |
|
IRelationType |
relationType |
|
Returns
Type |
Description |
IRelation |
|
Relate(IUmbracoEntity, IUmbracoEntity, String)
Declaration
public IRelation Relate(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
parent |
|
IUmbracoEntity |
child |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
IRelation |
|
Relate(Int32, Int32, IRelationType)
Declaration
public IRelation Relate(int parentId, int childId, IRelationType relationType)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
childId |
|
IRelationType |
relationType |
|
Returns
Type |
Description |
IRelation |
|
Relate(Int32, Int32, String)
Declaration
public IRelation Relate(int parentId, int childId, string relationTypeAlias)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
childId |
|
System.String |
relationTypeAlias |
|
Returns
Type |
Description |
IRelation |
|
Save(IRelation)
Declaration
public void Save(IRelation relation)
Parameters
Type |
Name |
Description |
IRelation |
relation |
|
Save(IRelationType)
Declaration
public void Save(IRelationType relationType)
Parameters
Type |
Name |
Description |
IRelationType |
relationType |
|
Save(IEnumerable<IRelation>)
Declaration
public void Save(IEnumerable<IRelation> relations)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IRelation> |
relations |
|