Example #1
0
 /// <summary>
 /// Lê o item associado com a chave informada.
 /// </summary>
 /// <param name="key">Chave do item.</param>
 /// <param name="item">Instancia do item que será recuperado.</param>
 /// <param name="providerName">Nome do provedor de leitura que será utilizado.</param>
 public void ReadThru(string key, out ProviderCacheItem item, string providerName)
 {
     item = null;
     if (_readerProivder != null)
     {
         ReadThruProviderManager mgr = null;
         if (string.IsNullOrEmpty(providerName))
         {
             providerName = this.DefaultReadThruProvider;
         }
         if (_readerProivder.ContainsKey(providerName.ToLower()))
         {
             _readerProivder.TryGetValue(providerName.ToLower(), out mgr);
             try
             {
                 if (mgr != null)
                 {
                     mgr.ReadThru(key, out item);
                 }
             }
             catch (Exception)
             {
                 throw;
             }
         }
     }
 }
Example #2
0
 /// <summary>
 /// Lê os itens associados com as chaves informadas.
 /// </summary>
 /// <param name="keys">Chaves que serão lidas.</param>
 /// <param name="providerName">Nome do provedor.</param>
 /// <returns></returns>
 public Dictionary <string, ProviderCacheItem> ReadThru(string[] keys, string providerName)
 {
     if (_readerProivder != null)
     {
         ReadThruProviderManager mgr = null;
         if (string.IsNullOrEmpty(providerName))
         {
             providerName = this.DefaultReadThruProvider;
         }
         if (_readerProivder.ContainsKey(providerName.ToLower()))
         {
             _readerProivder.TryGetValue(providerName.ToLower(), out mgr);
             if (mgr != null)
             {
                 return(mgr.ReadThru(keys));
             }
         }
     }
     return(null);
 }