예제 #1
0
        public override IEnumerable <VoipPhone> GetNumbers(params object[] ids)
        {
            var numbers = cache.Get(TenantID.ToString(CultureInfo.InvariantCulture)) as IEnumerable <VoipPhone>;

            if (numbers == null)
            {
                numbers = base.GetNumbers();
                cache.Insert(TenantID.ToString(CultureInfo.InvariantCulture), numbers, DateTime.UtcNow.Add(ExpirationTimeout));
            }

            return(ids.Any() ? numbers.Where(r => ids.Contains(r.Id) || ids.Contains(r.Number)) : numbers);
        }
        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);
        }