Exemplo n.º 1
0
        private async Task Save(CloudTable table, ShortUrl shortUrl, string rowKey)
        {
            shortUrl.PartitionKey = _partitionKey;
            shortUrl.RowKey       = rowKey;
            shortUrl.ETag         = "*";

            var mergeOperation = TableOperation.InsertOrMerge(shortUrl);
            await table.ExecuteAsync(mergeOperation);
        }
Exemplo n.º 2
0
        public async Task Save(ShortUrl shortUrl)
        {
            var byOriginalUrlTable = await _tableStorageContext.GetTableAsync(ByOriginalUrlTableName, true);

            await Save(byOriginalUrlTable, shortUrl, MakeSafeRowKey(shortUrl.Original));

            var byShortUrlTableName = await _tableStorageContext.GetTableAsync(ByShortUrlTableName, true);

            await Save(byShortUrlTableName, shortUrl, MakeSafeRowKey(shortUrl.Short));
        }