Beispiel #1
0
 private void ResetAMSScenerio()
 {
     Task.Run(() =>
     {
         EntityChangeObserverMaster.DataSetObserver(sessionAddressType, Zero, Zero, Zero);
     });
 }
        /// <summary>
        /// Retrieve cached item
        /// </summary>
        /// <typeparam name="T">Type of cached item</typeparam>
        /// <param name="key">Name of cached item</param>
        /// <param name="value">Cached value. Default(T) if item doesn't exist.</param>
        /// <returns>Cached item as type</returns>
        public static bool Get <T>(string key, int clientId, int countryId, int buId, out T value)
        {
            try
            {
                string consolidatedKey = clientId.ToString() + countryId.ToString() + buId.ToString() + key;
                if (EntityChangeObserverMaster.DataGetObserver(key, clientId, countryId, buId))
                {
                    Clear(consolidatedKey);
                }

                if (!Exists(consolidatedKey))
                {
                    value = default(T);
                    return(false);
                }

                value = Redishelper.GetItem <T>(consolidatedKey);
            }
            catch (Exception ex)
            {
                value = default(T);
                return(false);
            }

            return(true);
        }