public T Get <T>(Key key)
 {
     _logger.LogStoreCall("Get", key);
     try
     {
         return(_store.Get <T>(key));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex);
         throw;
     }
 }
Exemple #2
0
        public T Dequeue()
        {
            var    startIdx = _store.GetNextSequenceValue(_idxStartKey);
            string itemKey  = GetKeyFromIdx(startIdx);
            var    item     = _store.Get <T>(itemKey);

            if (item == null)
            {
                _store.GetNextSequenceValue(_idxEndKey);
            }
            else
            {
                _store.Delete(itemKey);
            }

            return(item);
        }
Exemple #3
0
        /// <summary>
        /// Retrieves all objects of type U and their retrospective keys whence given the key for type T
        /// </summary>
        /// <typeparam name="T">The type of the sorce object</typeparam>
        /// <typeparam name="U">The type of the related object</typeparam>
        /// <param name="store">The underlying store</param>
        /// <param name="keyT">The key of the source object</param>
        /// <param name="transformer"></param>
        /// <returns></returns>
        public static IEnumerable <KeyValuePair <string, U> > GetRelatedFor <T, U>(this IKVStore store, Key keyT,
                                                                                   ITypeStringTransformer transformer = null)
        {
            var tr = transformer ?? new ForeignKeyTypeStringTransformer();

            var keys = store.GetRelatedKeysFor <T, U>(keyT);

            return(keys.Select(key => new KeyValuePair <string, U>(key, store.Get <U>(key))));
        }
Exemple #4
0
 public T Get <T>(Key key)
 {
     return(_store.Get <T>(_GetTransformedKey <T>(key)));
 }
 public T Get <T>(Key key)
 {
     return(_store.Get <T>(key));
 }
Exemple #6
0
 private ulong GetSeqValue(string key)
 {
     return(_store.Get <ulong>(key));
 }
Exemple #7
0
 public T GetProfile(string username)
 {
     return(_store.Get <T>(username));
 }