Created
August 2, 2012 03:19
-
-
Save jeremyiverson/3232949 to your computer and use it in GitHub Desktop.
Colectica SDK: Find all referencing items, multiple levels away
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection<IdentifierTriple> GetReferencingItems(RepositoryClientBase client, IdentifierTriple objectId, Guid subjectType) | |
{ | |
// The set search will look for items of the specified type | |
// multiple levels away from the specified item. | |
// Note that this will be slower than a graph search, | |
// because the entire set must be determined. | |
// The ReverseTraversal property indicates that we want to | |
// find items that point *to* the specified item, instead | |
// of items referenced *by* the specified item. | |
SetSearchFacet facet = new SetSearchFacet() | |
{ | |
ReverseTraversal = true | |
}; | |
facet.ItemTypes.Add(subjectType); | |
return client.SearchTypedSet(objectId, facet).ToIdentifierCollection(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment