Skip to content

Instantly share code, notes, and snippets.

@jvanhoesen
Created June 2, 2021 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvanhoesen/b6e20e70c44430fe05c1e054db5c4a5b to your computer and use it in GitHub Desktop.
Save jvanhoesen/b6e20e70c44430fe05c1e054db5c4a5b to your computer and use it in GitHub Desktop.
Prefetch default implementation vs advanced implementation
//Default implementation
public void Prefetch()
{
_InventoryItems.Clear();
foreach (InventoryItem item in PXDatabase.SelectRecords<InventoryItem>())
{
_InventoryItems[item.InventoryID.Value] = item;
}
}
//New Implementation
public void Prefetch()
{
_InventoryItems.Clear();
foreach (InventoryItem item in AACache<InventoryItem>.SelectRecords())
{
_InventoryItems[item.InventoryID.Value] = item;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment