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

# OperationContext

> Represents context under which a operation is executed.             One instance created for one execution of one operation.

## Definition

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

**Namespace:** Microsoft.Restier.Core.Operation

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

## Syntax

```csharp theme={"dark"}
Microsoft.Restier.Core.Operation.OperationContext
```

## Summary

Represents context under which a operation is executed.
One instance created for one execution of one operation.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [OperationContext](/restier/api-reference/Microsoft/Restier/Core/Operation/OperationContext) class.

#### Syntax

```csharp theme={"dark"}
public OperationContext(Microsoft.Restier.Core.ApiBase api, System.Func<string, object> getParameterValueFunc, string operationName, bool isFunction, System.Collections.IEnumerable bindingParameterValue)
```

#### Parameters

| Name                    | Type                             | Description                                                                                          |
| ----------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `api`                   | `Microsoft.Restier.Core.ApiBase` | An Api.                                                                                              |
| `getParameterValueFunc` | `System.Func<string, object>`    | The function that used to retrieve the parameter value name.                                         |
| `operationName`         | `string`                         | The operation name.                                                                                  |
| `isFunction`            | `bool`                           | A flag indicates this is a function call or action call.                                             |
| `bindingParameterValue` | `System.Collections.IEnumerable` | A queryable for binding parameter value and if it is function/action import, the value will be null. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.InvocationContext`</Note>

Initializes a new instance of the [InvocationContext](/restier/api-reference/Microsoft/Restier/Core/InvocationContext) class.

#### Syntax

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

#### Parameters

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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Api <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.InvocationContext`</Note>

Gets the [ApiBase](/restier/api-reference/Microsoft/Restier/Core/ApiBase) descendant for this invocation.

#### Syntax

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

#### Property Value

Type: `Microsoft.Restier.Core.ApiBase`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> BindingParameterValue

Gets the queryable for binding parameter value,
and if it is function/action import, the value will be null.

#### Syntax

```csharp theme={"dark"}
public System.Collections.IEnumerable BindingParameterValue { get; }
```

#### Property Value

Type: `System.Collections.IEnumerable`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetParameterValueFunc

Gets the function that used to retrieve the parameter value name.

#### Syntax

```csharp theme={"dark"}
public System.Func<string, object> GetParameterValueFunc { get; }
```

#### Property Value

Type: `System.Func<string, object>`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> IsFunction

Gets a value indicating whether it is a function call or action call.

#### Syntax

```csharp theme={"dark"}
public bool IsFunction { get; }
```

#### Property Value

Type: `bool`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> OperationName

Gets the operation name.

#### Syntax

```csharp theme={"dark"}
public string OperationName { get; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ParameterValues

Gets or sets the parameters value array used by method,
It is only set after parameters are prepared.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.ICollection<object> ParameterValues { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.ICollection<object>`

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetApiService <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.InvocationContext`</Note>

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.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetApiService <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.InvocationContext`</Note>

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.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `string?`
