Skip to content

Instantly share code, notes, and snippets.

@lhall690
Created October 12, 2021 15:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lhall690/45c52c52ec598dbe866f897ae861ebcd to your computer and use it in GitHub Desktop.
[CODE LANG=CSHARP]
PUBLIC STATIC CLASS CACHEMANAGER
{
PUBLIC STATIC EXPENSIVEOBJECT GETEXPENSIVEOBJECT()
{
VAR CACHE = HTTPCONTEXT.CURRENT.CACHE;
VAR OBJ = CACHE[THE_KEY] AS EXPENSIVEOBJECT;
IF (OBJ == NULL)
{
OBJ = GETITFROMSOURCE();
}
RETURN OBJ;
}
}
[/CODE]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment