async Task IBotDataStore <BotData> .SaveAsync(IAddress key, BotStoreType botStoreType, BotData botData, CancellationToken cancellationToken)
        {
            var           entityKey = BotDataEntity.GetEntityKey(key, botStoreType);
            BotDataEntity entity    = new BotDataEntity(key.BotId, key.ChannelId, key.ConversationId, key.UserId, botData.Data)
            {
                ETag = botData.ETag
            };

            entity.PartitionKey = entityKey.PartitionKey;
            entity.RowKey       = entityKey.RowKey;

            try
            {
                if (String.IsNullOrEmpty(entity.ETag))
                {
                    await this.Table.ExecuteAsync(TableOperation.Insert(entity));
                }
                else if (entity.ETag == "*")
                {
                    if (botData.Data != null)
                    {
                        await this.Table.ExecuteAsync(TableOperation.InsertOrReplace(entity));
                    }
                    else
                    {
                        await this.Table.ExecuteAsync(TableOperation.Delete(entity));
                    }
                }
                else
                {
                    if (botData.Data != null)
                    {
                        await this.Table.ExecuteAsync(TableOperation.Replace(entity));
                    }
                    else
                    {
                        await this.Table.ExecuteAsync(TableOperation.Delete(entity));
                    }
                }
            }
            catch (StorageException err)
            {
                if ((HttpStatusCode)err.RequestInformation.HttpStatusCode == HttpStatusCode.Conflict)
                {
                    throw new HttpException((int)HttpStatusCode.PreconditionFailed, err.RequestInformation.HttpStatusMessage);
                }

                throw new HttpException(err.RequestInformation.HttpStatusCode, err.RequestInformation.HttpStatusMessage);
            }
        }
        async Task <BotData> IBotDataStore <BotData> .LoadAsync(IAddress key, BotStoreType botStoreType, CancellationToken cancellationToken)
        {
            var entityKey = BotDataEntity.GetEntityKey(key, botStoreType);

            try
            {
                var result = await this.Table.ExecuteAsync(TableOperation.Retrieve <BotDataEntity>(entityKey.PartitionKey, entityKey.RowKey));

                BotDataEntity entity = (BotDataEntity)result.Result;
                if (entity == null)
                {
                    // empty record ready to be saved
                    return(new BotData(eTag: String.Empty, data: null));
                }

                // return botdata
                return(new BotData(entity.ETag, entity.GetData()));
            }
            catch (StorageException err)
            {
                throw new HttpException(err.RequestInformation.HttpStatusCode, err.RequestInformation.HttpStatusMessage);
            }
        }