public static T GetObjectFromCache <T>(string name) { lock (_lock) { return(SessionContainer.GetService <IObjectStore <T> >().GetObject(name).Value); } }
public static IObjectStore <T> GetObjectCache <T>() { lock (_lock) { var os = SessionContainer.GetService <IObjectStore <T> >(); _registeredTypes.AddOrUpdate(typeof(T), os, (x, y) => os); return(os); } }
public static void FlushCache <T>() => SessionContainer.GetService <IObjectStore <T> >().Clear();
public static void PutObjectToCache <T>(string name, T obj) => SessionContainer.GetService <IObjectStore <T> >().PutObject(name, new SessionItem <T> { Name = name, Value = obj, Version = 1 });
public static T GetObjectFromCache <T>(string name) => SessionContainer.GetService <IObjectStore <T> >().GetObject(name).Value;
public static IObjectStore <T> GetObjectCache <T>() => SessionContainer.GetService <IObjectStore <T> >();