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