public Task AddDialogConditionAsync(IDialogCondition condition)
        {
            var tasks = new List <Task>
            {
                _conditionsRepository.AddDialogConditionAsync(condition),
                _clientDialogsRepository.SetDialogConditionTypeAsync(condition.DialogId, condition.Type)
            };

            return(Task.WhenAll(tasks));
        }
 internal static DialogConditionEntity Create(IDialogCondition condition)
 {
     return(new DialogConditionEntity
     {
         PartitionKey = GeneratePartitionKey(condition.Type),
         RowKey = GenerateRowKey(condition.DialogId),
         DialogId = condition.DialogId,
         Type = condition.Type,
         Data = condition.Data
     });
 }
        public Task AddDialogConditionAsync(IDialogCondition condition)
        {
            var entity = DialogConditionEntity.Create(condition);
            var index  = AzureIndex.Create(DialogConditionEntity.GenerateIndexPartitionKey(condition.DialogId), condition.DialogId,
                                           DialogConditionEntity.GeneratePartitionKey(condition.Type), DialogConditionEntity.GenerateRowKey(condition.DialogId));

            var tasks = new List <Task>
            {
                _tableStorage.InsertOrMergeAsync(entity),
                _typeIndex.InsertOrMergeAsync(index)
            };

            return(Task.WhenAll(tasks));
        }