> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# QueryContext

> Represents context under which a query flow operates.

## Definition

**Assembly:** Microsoft.Restier.Core.dll

**Namespace:** Microsoft.Restier.Core.Query

**Inheritance:** Microsoft.Restier.Core.InvocationContext

## Syntax

```csharp theme={"dark"}
Microsoft.Restier.Core.Query.QueryContext
```

## Summary

Represents context under which a query flow operates.

## Constructors

### &#x20;.ctor

Initializes a new instance of the [QueryContext](https://easyaf.nimbleapps.cloud/restier/api-reference/Microsoft/Restier/Core/Query/QueryContext.md) class.

#### Syntax

```csharp theme={"dark"}
public QueryContext(Microsoft.Restier.Core.ApiBase api, Microsoft.Restier.Core.Query.QueryRequest request)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `api` | `Microsoft.Restier.Core.ApiBase` | An Api. |
| `request` | `Microsoft.Restier.Core.Query.QueryRequest` | A query request. |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `Microsoft.Restier.Core.InvocationContext`

Initializes a new instance of the [InvocationContext](https://easyaf.nimbleapps.cloud/restier/api-reference/Microsoft/Restier/Core/InvocationContext.md) class.

#### Syntax

```csharp theme={"dark"}
public InvocationContext(Microsoft.Restier.Core.ApiBase api)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `api` | `Microsoft.Restier.Core.ApiBase` | An Api. |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;Api Inherited

> [!NOTE]
>
> Inherited from `Microsoft.Restier.Core.InvocationContext`

Gets the [ApiBase](https://easyaf.nimbleapps.cloud/restier/api-reference/Microsoft/Restier/Core/ApiBase.md) descendant for this invocation.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Restier.Core.ApiBase Api { get; }
```

#### Property Value

Type: `Microsoft.Restier.Core.ApiBase`

### &#x20;Model

Gets the model that informs this query context.

#### Syntax

```csharp theme={"dark"}
public Microsoft.OData.Edm.IEdmModel Model { get; internal set; }
```

#### Property Value

Type: `Microsoft.OData.Edm.IEdmModel`

### &#x20;Request

Gets the query request.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Restier.Core.Query.QueryRequest Request { get; private set; }
```

#### Property Value

Type: `Microsoft.Restier.Core.Query.QueryRequest`

#### Remarks

The query request cannot be set if there is already a result.

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetApiService Inherited

> [!NOTE]
>
> Inherited from `Microsoft.Restier.Core.InvocationContext`

Gets an API service.

#### Syntax

```csharp theme={"dark"}
public T GetApiService<T>() where T : class
```

#### Returns

Type: `T`
The API service instance.

#### Type Parameters

* `T` - The API service type.

### &#x20;GetApiService Inherited

> [!NOTE]
>
> Inherited from `Microsoft.Restier.Core.InvocationContext`

Gets an API service.

#### Syntax

```csharp theme={"dark"}
public object GetApiService(System.Type type)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `type` | `System.Type` | The API service type. |

#### Returns

Type: `object`
The API service instance.

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.