Skip to content

Instantly share code, notes, and snippets.

@DanSmith
Last active April 6, 2022 21:36
Show Gist options
  • Save DanSmith/833a10b87317d7e5dd794c9e1908c088 to your computer and use it in GitHub Desktop.
Save DanSmith/833a10b87317d7e5dd794c9e1908c088 to your computer and use it in GitHub Desktop.
Populate a variable set and all children using two REST calls to the Colectica Respotiroy
// First, start with an instance of the variable scheme
var variableScheme = client.GetItem(variableSchemeId, ChildReferenceProcessing.Instantiate);
// The SetPopulator uses only two Repository calls to populate the entire item graph.
// The populator will call the Repository GetSet to find all identifiers, then the GetItems to retrieve all DDI for all items
// It will recurse all the children, children of children, etc within this graph of items, and populate them
SetPopulator setPopulator = new SetPopulator(client);
variableScheme.Accept(setPopulator);
// The variable set, and all its children, are now completely populated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment