Skip to content
JuDelCo edited this page May 20, 2021 · 2 revisions

Namespace: Ju.Services

ICacheService

This service provides a centralized storage of objects. Can be used to store and retrieve easily objects using string identifiers.

You can also store list of objects of the same type and retrieve all the objects at once.

void Set<T>(T obj, bool overwrite = true);
void Set<T>(T obj, string id, bool overwrite = true);
T Get<T>();
T Get<T>(string id);
void Unset<T>();
void Unset<T>(string id);

IEnumerable<Type> GetTypes();

void ListAdd<T>(T obj);
void ListAdd<T>(T obj, string id);
List<T> ListGet<T>();
List<T> ListGet<T>(string id);
void ListRemove<T>(T obj);
void ListRemove<T>(T obj, string id);

IEnumerable<Type> ListGetTypes();

Events

CacheAddEvent(Type type, object obj);
CacheRemoveEvent(Type type, object obj);

GetTypes()

Get all the object types stored in the service.

ListGetTypes()

Get all the list object types stored in the service.

Clone this wiki locally