public Task DeleteDialogAsync(string clientId, string dialogId) { var tasks = new List <Task> { _clientDialogIndex.DeleteIfExistAsync(clientId, dialogId), _clientDialogIndex.DeleteIfExistAsync(ClientDialogEntity.GenerateDialogIndex(dialogId), clientId) }; return(Task.WhenAll(tasks)); }
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); }
private AzureIndex CreateDialogIndex(string clientId, string dialogId) { return(AzureIndex.Create(ClientDialogEntity.GenerateDialogIndex(dialogId), clientId, ClientDialogEntity.GeneratePartitionKey(), dialogId)); }