# AuditQuery

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.auditquery/
> Summary: AuditQuery: The criteria that filter an audit trail query.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The criteria that filter an audit trail query.

```csharp
public sealed record AuditQuery : IEquatable<AuditQuery>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.auditquery/">AuditQuery</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;AuditQuery&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Constructors

### <a id="Tracon_AuditQuery__ctor"></a> AuditQuery\(\)

```csharp
public AuditQuery()
```

## Properties

### <a id="Tracon_AuditQuery_Action"></a> Action

Gets the action filter, for example `agent.update`.

```csharp
public string? Action { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AuditQuery_Actor"></a> Actor

Gets the actor filter. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) includes every actor.

```csharp
public string? Actor { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AuditQuery_After"></a> After

Gets the lower bound: the records written after this time.

```csharp
public DateTimeOffset? After { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)?

### <a id="Tracon_AuditQuery_Before"></a> Before

Gets the upper bound: the records written before this time.

```csharp
public DateTimeOffset? Before { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)?

### <a id="Tracon_AuditQuery_Entity"></a> Entity

Gets the entity filter, for example `agent:support`.

```csharp
public string? Entity { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AuditQuery_Limit"></a> Limit

Gets the upper number of records to return.

```csharp
public int Limit { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_AuditQuery_TenantId"></a> TenantId

Gets the tenant id. AMBIENT fallback: the caller's own
[ITenantContext.TenantId](/api/tracon.itenantcontext/#Tracon_ITenantContext_TenantId) is used when this is
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or empty — never "every tenant". See
[IAuditLog](/api/tracon.iauditlog/)'s remarks for the full contract.

```csharp
public string? TenantId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

## Methods

### <a id="Tracon_AuditQuery_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AuditQuery_Equals_Tracon_AuditQuery_"></a> Equals\(AuditQuery?\)

```csharp
public bool Equals(AuditQuery? other)
```

#### Parameters

`other` [AuditQuery](/api/tracon.auditquery/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AuditQuery_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_AuditQuery_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_AuditQuery_op_Equality_Tracon_AuditQuery_Tracon_AuditQuery_"></a> operator ==\(AuditQuery?, AuditQuery?\)

```csharp
public static bool operator ==(AuditQuery? left, AuditQuery? right)
```

#### Parameters

`left` [AuditQuery](/api/tracon.auditquery/)?

`right` [AuditQuery](/api/tracon.auditquery/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AuditQuery_op_Inequality_Tracon_AuditQuery_Tracon_AuditQuery_"></a> operator \!=\(AuditQuery?, AuditQuery?\)

```csharp
public static bool operator !=(AuditQuery? left, AuditQuery? right)
```

#### Parameters

`left` [AuditQuery](/api/tracon.auditquery/)?

`right` [AuditQuery](/api/tracon.auditquery/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
