Skip to content

Instantly share code, notes, and snippets.

@techphoria414
Created November 16, 2013 22:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techphoria414/7506347 to your computer and use it in GitHub Desktop.
Save techphoria414/7506347 to your computer and use it in GitHub Desktop.
Sitecore ItemProvider does not provide 100% coverage for manipulating data behavior. You potentially need to implement both an ItemProvider and a GetItemCommand, or just the latter.
//ItemProvider works via GetItem override
Sitecore.Context.Database.Items[Sitecore.Data.ID.Parse("{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}")].Children;
//ItemProvider works via GetChildren override
Sitecore.Data.Items.Item[] items = Sitecore.Context.Database.SelectItems("/sitecore/content/Home/*[@__isFolder='1']");
//ItemProvider doesn’t work, never called
items = Sitecore.Context.Database.SelectItems("/sitecore/content/Home/*");
//ItemProvider doesn’t work, never called
Sitecore.Data.Items.Item item = Sitecore.Context.Database.SelectSingleItem("/sitecore/content/Home");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment