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