コード例 #1
0
 public Task SetDialogConditionTypeAsync(string dialogId, DialogConditionType?type)
 {
     return(_tableStorage.ReplaceAsync(ClientDialogEntity.GeneratePartitionKey(),
                                       ClientDialogEntity.GenerateRowKey(dialogId),
                                       entity =>
     {
         entity.ConditionType = type;
         return entity;
     }));
 }
コード例 #2
0
        public async Task DeleteDialogAsync(string dialogId)
        {
            await _tableStorage.DeleteIfExistAsync(ClientDialogEntity.GeneratePartitionKey(), ClientDialogEntity.GenerateRowKey(dialogId));

            var tasks = new List <Task>();

            var dialogIndexes = (await _clientDialogIndex.GetDataAsync(ClientDialogEntity.GenerateDialogIndex(dialogId))).ToList();

            foreach (var index in dialogIndexes)
            {
                tasks.Add(_clientDialogIndex.DeleteIfExistAsync(index.RowKey, dialogId));
                tasks.Add(_clientDialogIndex.DeleteIfExistAsync(ClientDialogEntity.GenerateDialogIndex(dialogId), index.RowKey));
            }

            tasks.Add(UnAssignGlobalDialogAsync(dialogId));

            await Task.WhenAll(tasks);
        }
コード例 #3
0
 private AzureIndex CreateGlobalDialogIndex(string dialogId)
 {
     return(AzureIndex.Create(ClientDialogEntity.GenerateGlobalDialogPartitionKey(), dialogId,
                              ClientDialogEntity.GeneratePartitionKey(), dialogId));
 }
コード例 #4
0
 public async Task <IClientDialog> GetDialogAsync(string dialogId)
 {
     return(await _tableStorage.GetDataAsync(ClientDialogEntity.GeneratePartitionKey(),
                                             ClientDialogEntity.GenerateRowKey(dialogId)));
 }
コード例 #5
0
 private AzureIndex CreateClientDialogIndex(string clientId, string dialogId)
 {
     return(AzureIndex.Create(clientId, dialogId, ClientDialogEntity.GeneratePartitionKey(), dialogId));
 }