static async Task <IDictionary <string, StoredServiceIdentity> > ReadCacheFromStore(IKeyValueStore <string, string> encryptedStore) { IDictionary <string, StoredServiceIdentity> cache = new Dictionary <string, StoredServiceIdentity>(); await encryptedStore.IterateBatch( int.MaxValue, (key, value) => { cache.Add(key, JsonConvert.DeserializeObject <StoredServiceIdentity>(value)); return(Task.CompletedTask); }); return(cache); }
public async Task <IDictionary <string, StoredServiceIdentity> > ReadCacheFromStore(IKeyValueStore <string, string> encryptedStore, string actorDeviceId) { IDictionary <string, StoredServiceIdentity> cache = new Dictionary <string, StoredServiceIdentity>(); await encryptedStore.IterateBatch( int.MaxValue, (key, value) => { var storedIdentity = JsonConvert.DeserializeObject <StoredServiceIdentity>(value); cache.Add(key, storedIdentity); return(Task.CompletedTask); }); await this.RestoreDeviceScope(encryptedStore, actorDeviceId, cache); return(cache); }