Пример #1
0
        public async Task UpdateAuditRecordAsync(AuditRecord record)
        {
            if (record is UserAuditRecord userRecord)
            {
                List <UserAuditRecord> list =
                    await storage.ReadAsync <UserAuditRecord>(tableName, record.PartitionKey, record.RowKey);

                if (list?.Count == 1)
                {
                    UserAuditRecord updateRecord = list[0];
                    updateRecord.LogoutTime = userRecord.LogoutTime;
                    storage.WriteAsync(tableName, updateRecord).IgnoreException();
                }
            }
        }
Пример #2
0
 public async Task WriteAuditRecordAsync(AuditRecord record)
 {
     storage.WriteAsync(tableName, record).IgnoreException();
     await Task.CompletedTask;
 }
Пример #3
0
 public async Task WriteAuditRecordAsync(AuditRecord record)
 {
     byte[] source = Encoding.UTF8.GetBytes(record.ConvertToCsv());
     storage.AppendFileAsync(path, source).IgnoreException();
     await Task.CompletedTask;
 }