public dynamic GetSubscriptionByApplicationId(string applicationId) { var subscriber = _cache.Get(_cacheAppId + applicationId) as SubscriberModel; if (subscriber != null && subscriber.Version == VersionNumber) { return(subscriber.ToDynamic()); } subscriber = StorageMethod.GetByApplicationId(applicationId); if (subscriber != null && subscriber.Version == VersionNumber) { _cache.Add(_cacheAppId + applicationId, subscriber, MyCachePriority.Default); return(subscriber.ToDynamic()); } var result = _webClientService.GetSubscriptionByApplicationId(applicationId); subscriber = JsonConvert.DeserializeObject <SubscriberModel>(result); if (subscriber == null) { return(null); } _cache.Add(_cacheAppId + applicationId, subscriber, MyCachePriority.Default); StorageMethod.AddOrUpdateSubscriber(subscriber); return(subscriber.ToDynamic()); }