# SessionQuery

> 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.sessionquery/
> Summary: SessionQuery: A filter for querying the session list.

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

A filter for querying the session list.

```csharp
public sealed record SessionQuery : IEquatable<SessionQuery>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.sessionquery/">SessionQuery</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;SessionQuery&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_SessionQuery__ctor"></a> SessionQuery\(\)

```csharp
public SessionQuery()
```

## Properties

### <a id="Tracon_SessionQuery_AgentName"></a> AgentName

Fetches only this agent's sessions.

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

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

Fetches only this owner's sessions. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) applies no
owner filter at all and lists the whole tenant, which is what a
management listing wants.

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

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

**The filter is applied BEFORE [SessionQuery.Skip](/api/tracon.sessionquery/#Tracon_SessionQuery_Skip) and
[SessionQuery.Take](/api/tracon.sessionquery/#Tracon_SessionQuery_Take).** A store that filters the page it already
fetched returns short pages, empty pages, and — worst — lets a caller
infer how many sessions OTHER users hold from the gaps. Paging runs over
the already-narrowed set, so the paging contract stays intact and no
count leaks.

A row whose [SessionRecord.OwnerId](/api/tracon.sessionrecord/#Tracon_SessionRecord_OwnerId) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null)
is not matched by any owner filter. Unowned rows are not "everyone's";
they are nobody's.

### <a id="Tracon_SessionQuery_Skip"></a> Skip

The number of records to skip.

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

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

The maximum number of records to fetch.

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

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

Fetches only this tenant's sessions.

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

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

### <a id="Tracon_SessionQuery_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_SessionQuery_Equals_Tracon_SessionQuery_"></a> Equals\(SessionQuery?\)

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

`other` [SessionQuery](/api/tracon.sessionquery/)?

#### Returns

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

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

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

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

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

### <a id="Tracon_SessionQuery_op_Equality_Tracon_SessionQuery_Tracon_SessionQuery_"></a> operator ==\(SessionQuery?, SessionQuery?\)

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

`left` [SessionQuery](/api/tracon.sessionquery/)?

`right` [SessionQuery](/api/tracon.sessionquery/)?

#### Returns

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

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

`left` [SessionQuery](/api/tracon.sessionquery/)?

`right` [SessionQuery](/api/tracon.sessionquery/)?

#### Returns

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