示例#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> >();