Skip to content

Instantly share code, notes, and snippets.

@ste-bel
Last active November 27, 2020 02:53
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 ste-bel/45a9e58f89054a70a76520137e825322 to your computer and use it in GitHub Desktop.
Save ste-bel/45a9e58f89054a70a76520137e825322 to your computer and use it in GitHub Desktop.
Slot caching methods
public static ObjectType GetSlot<ObjectType>(string key, params Type[] tables)
where ObjectType : class, new() {
// Retrieves or creates a cache based on a key and some dependent tables.
// Unless noted, there is one cache per company/set of key/table/parameter
}
public static ObjectType GetSlot<ObjectType, Parameter>(string key, Parameter parameter, params Type[] tables)
where ObjectType : class, IPrefetchable<Parameter>, new() {
// Retrieves or creates a cache based on a key, a Parameter and some dependent tables
}
public static ObjectType GetLocalizableSlot<ObjectType>(string key, params Type[] tables)
where ObjectType : class, new() {
// Retrieves or creates a cache based on a key, the current Thread language and some dependent tables
}
public static ObjectType GetLocalizableSlot<ObjectType, Parameter>(string key, Parameter parameter, params Type[] tables)
where ObjectType : class, IPrefetchable<Parameter>, new() {
// Retrieves or creates a cache based on a key, a Parameter, the current Thread language and some dependent tables
}
public static void ResetSlot<ObjectType>(string key, params Type[] tables)
where ObjectType : class, new() {
// Clears the cache(s) based on a key and some dependent tables (for all languages if Localizable and all parameters)
}
public static void ResetSlotForAllCompanies(string key, params Type[] tables) {
// Clears the cache(s) based on a key some dependent tables (across all companies)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment