public bool IsInstallRegistered(string userEmail, MobileAppType?appType)
        {
            if (string.IsNullOrEmpty(userEmail))
            {
                return(false);
            }
            object cachedValue = cache.Get(GetCacheKey(userEmail, appType));

            if (cachedValue != null)
            {
                return((bool)cachedValue);
            }

            var isRegistered = registrator.IsInstallRegistered(userEmail, appType);

            cache.Insert(GetCacheKey(userEmail, appType), isRegistered, cacheExpiration);
            return(isRegistered);
        }
Example #2
0
        public bool IsInstallRegistered(string userEmail, MobileAppType?appType)
        {
            if (string.IsNullOrEmpty(userEmail))
            {
                return(false);
            }

            var fromCache = cache.Get <string>(GetCacheKey(userEmail, appType));


            if (bool.TryParse(fromCache, out var cachedValue))
            {
                return(cachedValue);
            }

            var isRegistered = registrator.IsInstallRegistered(userEmail, appType);

            cache.Insert(GetCacheKey(userEmail, appType), isRegistered.ToString(), cacheExpiration);
            return(isRegistered);
        }