Example #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();
                }
            }
        }
Example #2
0
 public async Task WriteAuditRecordAsync(AuditRecord record)
 {
     storage.WriteAsync(tableName, record).IgnoreException();
     await Task.CompletedTask;
 }
Example #3
0
 public async Task WriteAuditRecordAsync(AuditRecord record)
 {
     byte[] source = Encoding.UTF8.GetBytes(record.ConvertToCsv());
     storage.AppendFileAsync(path, source).IgnoreException();
     await Task.CompletedTask;
 }