Ejemplo n.º 1
0
 /// <summary>
 /// Recupera o item pela chave informada.
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public override object Get(object key)
 {
     try
     {
         MmfObjectPtr info = (MmfObjectPtr)_itemDict[key];
         if (info != null)
         {
             return(StoreItem.FromBinary(_internalStore.Get(info), base.CacheContext).Value);
         }
     }
     catch (Exception exception)
     {
         Trace.Error("MmfStorageProvider.Get()".GetFormatter(), exception.GetFormatter());
     }
     return(null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Provides implementation of Get method of the ICacheStorage interface.
 /// Get an object from the store, specified by the passed in key.
 /// </summary>
 /// <param name="key">key</param>
 /// <returns>object</returns>
 public override object Get(object key)
 {
     try
     {
         MmfObjectPtr info = (MmfObjectPtr)_itemDict[key];
         if (info != null)
         {
             byte[]    data = _internalStore.Get(info);
             StoreItem item = StoreItem.FromBinary(data, CacheContext);
             return(item.Value);
         }
     }
     catch (Exception e)
     {
         Trace.error("MmfStorageProvider.Get()", e.ToString());
     }
     return(null);
 }