Skip to content

Instantly share code, notes, and snippets.

@jeremyiverson
Created August 2, 2012 03:19
Show Gist options
  • Save jeremyiverson/3232949 to your computer and use it in GitHub Desktop.
Save jeremyiverson/3232949 to your computer and use it in GitHub Desktop.
Colectica SDK: Find all referencing items, multiple levels away
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