View Source
  Interface IRelationRepository
  
  
  
  
  Assembly: Umbraco.Core.dll
  Syntax
  
    public interface IRelationRepository : IReadWriteQueryRepository<int, IRelation>, IReadRepository<int, IRelation>, IWriteRepository<IRelation>, IQueryRepository<IRelation>, IRepository
   
  Methods
  
  
    View Source
  
  DeleteByParent(Int32, String[])
  Deletes all relations for a parent for any specified relation type alias
Declaration
  
    void DeleteByParent(int parentId, params string[] relationTypeAliases)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int32 | parentId |  | 
      
        | System.String[] | relationTypeAliases | A list of relation types to match for deletion, if none are specified then all relations for this parent id are deleted. | 
    
  
  
    View Source
  
  GetPagedByChildKeyAsync(Guid, Int32, Int32, String)
  
  
  Declaration
  
    Task<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
  
  GetPagedChildEntitiesByParentId(Int32, Int64, Int32, out Int64, Guid[])
  
  
  Declaration
  
    IEnumerable<IUmbracoEntity> GetPagedChildEntitiesByParentId(int parentId, long pageIndex, int pageSize, out long totalRecords, params Guid[] entityTypes)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int32 | parentId |  | 
      
        | System.Int64 | pageIndex |  | 
      
        | System.Int32 | pageSize |  | 
      
        | System.Int64 | totalRecords |  | 
      
        | Guid[] | entityTypes |  | 
    
  
  Returns
  
  
    View Source
  
  GetPagedParentEntitiesByChildId(Int32, Int64, Int32, out Int64, Guid[])
  
  
  Declaration
  
    IEnumerable<IUmbracoEntity> GetPagedParentEntitiesByChildId(int childId, long pageIndex, int pageSize, out long totalRecords, params Guid[] entityTypes)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int32 | childId |  | 
      
        | System.Int64 | pageIndex |  | 
      
        | System.Int32 | pageSize |  | 
      
        | System.Int64 | totalRecords |  | 
      
        | Guid[] | entityTypes |  | 
    
  
  Returns
  
  
    View Source
  
  GetPagedRelationsByQuery(IQuery<IRelation>, Int64, Int32, out Int64, Ordering)
  
  
  Declaration
  
    IEnumerable<IRelation> GetPagedRelationsByQuery(IQuery<IRelation> query, long pageIndex, int pageSize, out long totalRecords, Ordering ordering)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | IQuery<IRelation> | query |  | 
      
        | System.Int64 | pageIndex |  | 
      
        | System.Int32 | pageSize |  | 
      
        | System.Int64 | totalRecords |  | 
      
        | Ordering | ordering |  | 
    
  
  Returns
  
  
    View Source
  
  Save(IEnumerable<IRelation>)
  
  
  Declaration
  
    void Save(IEnumerable<IRelation> relations)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | IEnumerable<IRelation> | relations |  | 
    
  
  
    View Source
  
  SaveBulk(IEnumerable<ReadOnlyRelation>)
  Persist multiple IRelation at once but Ids are not returned on created relations
Declaration
  
    void SaveBulk(IEnumerable<ReadOnlyRelation> relations)
   
  Parameters