示例#1
0
        public async Task DeleteKeyValueHistoryAsync(string keyValueId, string description, string userName, string userIpAddress)
        {
            var th = new KeyValueHistory
            {
                KeyValueId    = keyValueId,
                PartitionKey  = KeyValueHistory.GeneratePartitionKey(),
                RowKey        = DateTime.UtcNow.StorageString(),
                UserName      = userName,
                UserIpAddress = userIpAddress
            };

            th.KeyValuesSnapshot = $"{th.UserName}_{th.RowKey}_{th.UserIpAddress}";

            await _blobStorage.SaveBlobAsync(_container, th.KeyValuesSnapshot, Encoding.UTF8.GetBytes(description));

            await _tableStorage.InsertOrMergeAsync(th);
        }
示例#2
0
        public async Task SaveKeyValueHistoryAsync(string keyValueId, string newValue, string keyValues, string userName,
                                                   string userIpAddress, DateTime atDate)
        {
            var th = new KeyValueHistory
            {
                KeyValueId    = keyValueId,
                NewValue      = newValue,
                PartitionKey  = KeyValueHistory.GeneratePartitionKey(),
                RowKey        = atDate.StorageString(),
                UserName      = userName,
                UserIpAddress = userIpAddress
            };

            th.KeyValuesSnapshot = $"{th.UserName}_{th.RowKey}_{th.UserIpAddress}";

            await _blobStorage.SaveBlobAsync(_container, th.KeyValuesSnapshot, Encoding.UTF8.GetBytes(keyValues));

            await _tableStorage.InsertOrMergeAsync(th);
        }
示例#3
0
 public async Task DeleteKeyValueHistoryFromDbAsync(string rowKey)
 {
     await _tableStorage.DeleteAsync(KeyValueHistory.GeneratePartitionKey(), rowKey);
 }