Exemple #1
0
        public async Task <IEnumerable <IClientDialog> > GetClientDialogsAsync(string clientId)
        {
            var indexesTask       = _clientDialogIndex.GetDataAsync(clientId);
            var globalIndexesTask = _globalDialogIndex.GetDataAsync(ClientDialogEntity.GenerateGlobalDialogPartitionKey());

            await Task.WhenAll(indexesTask, globalIndexesTask);

            var indexes       = await indexesTask;
            var globalIndexes = await globalIndexesTask;

            var clientDialogs = (await _tableStorage.GetDataAsync(indexes)).ToList();
            var globalDialogs = (await _tableStorage.GetDataAsync(globalIndexes)).ToList();

            clientDialogs.AddRange(globalDialogs.Where(item => clientDialogs.All(x => x.Id != item.Id)));

            return(clientDialogs);
        }
Exemple #2
0
 private AzureIndex CreateGlobalDialogIndex(string dialogId)
 {
     return(AzureIndex.Create(ClientDialogEntity.GenerateGlobalDialogPartitionKey(), dialogId,
                              ClientDialogEntity.GeneratePartitionKey(), dialogId));
 }
Exemple #3
0
 public Task UnAssignGlobalDialogAsync(string dialogId)
 {
     return(_globalDialogIndex.DeleteIfExistAsync(ClientDialogEntity.GenerateGlobalDialogPartitionKey(), dialogId));
 }
Exemple #4
0
        public async Task <IEnumerable <IClientDialog> > GetGlobalDialogsAsync()
        {
            var indexes = await _globalDialogIndex.GetDataAsync(ClientDialogEntity.GenerateGlobalDialogPartitionKey());

            return(await _tableStorage.GetDataAsync(indexes));
        }