public async Task <IEnumerable <KeyValuePair <DateTime, Message> > > GetMessagesAsync() { IReliableDictionary <DateTime, Message> messagesDictionary = await this.StateManager.GetOrAddAsync <IReliableDictionary <DateTime, Message> >("messages"); return(messagesDictionary.CreateEnumerable(EnumerationMode.Ordered)); }
public async Task <IEnumerable <ClusterView> > GetClusterList() { IReliableDictionary <int, Cluster> clusterDictionary = await this.reliableStateManager.GetOrAddAsync <IReliableDictionary <int, Cluster> >(ClusterDictionaryName); return(from cluster in clusterDictionary.CreateEnumerable(EnumerationMode.Ordered) where cluster.Value.Status == ClusterStatus.Ready select new ClusterView() { AppCount = cluster.Value.AppCount, Name = "Party Cluster " + cluster.Key, ServiceCount = cluster.Value.ServiceCount, Uptime = DateTimeOffset.UtcNow - cluster.Value.CreatedOn.ToUniversalTime(), UserCount = cluster.Value.Users.Count }); }