private async Task <dynamic> GetItem(object cacheKey, string region) { var item = await Task.Factory.StartNew(() => MongoUtilities.InitializeMongoDatabase(region, _mongoConnectionString).AsQueryable <dynamic>() .AsParallel() .FirstOrDefault(x => x.CacheKey.Equals(cacheKey.ToString(), StringComparison.CurrentCultureIgnoreCase) && x.Expires > DateTime.UtcNow)); if (item == null) { return(null); } // todo can be removed after dec if (GlobalUtilities.DoesPropertyExist(item, "AllowSliddingTime") || GlobalUtilities.DoesPropertyExist(item.CacheOptions.AllowSliddingTime, "AllowSliddingTime")) { await UpdateSliddingTime(region, item); } return(item); }