Last active
April 6, 2022 21:36
-
-
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
This file contains hidden or 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
// 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