# HttpContextInterlocked.Exchange

Kind: Method  
Namespace: `Sisk.Core.Http`  
Assembly: `Sisk.Core.dll`  
Source: https://docs.sisk-framework.org/api/Sisk.Core.Http.HttpContext.HttpContextInterlocked.Exchange.html

## Exchange(string, long) {#Sisk_Core_Http_HttpContext_HttpContextInterlocked_Exchange_System_String_System_Int64_}

Atomically replaces the value associated with the specified name.

```csharp
public double Exchange(string name, long value)
```

### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the value.

`value` [long](https://learn.microsoft.com/dotnet/api/system.int64)

The replacement value.

### Returns

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

The original stored value, or `value` when the name was not present.

## Exchange(string, double) {#Sisk_Core_Http_HttpContext_HttpContextInterlocked_Exchange_System_String_System_Double_}

Atomically replaces the value associated with the specified name.

```csharp
public double Exchange(string name, double value)
```

### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the value.

`value` [double](https://learn.microsoft.com/dotnet/api/system.double)

The replacement value.

### Returns

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

The original stored value, or `value` when the name was not present.

## Exchange(string, long) {#Sisk_Core_Http_HttpContext_HttpContextInterlocked_Exchange_System_String_System_Int64_}

Atomically replaces the value associated with the specified name.

```csharp
public double Exchange(string name, long value)
```

### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the value.

`value` [long](https://learn.microsoft.com/dotnet/api/system.int64)

The replacement value.

### Returns

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

The original stored value, or `value` when the name was not present.

## Exchange(string, double) {#Sisk_Core_Http_HttpContext_HttpContextInterlocked_Exchange_System_String_System_Double_}

Atomically replaces the value associated with the specified name.

```csharp
public double Exchange(string name, double value)
```

### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the value.

`value` [double](https://learn.microsoft.com/dotnet/api/system.double)

The replacement value.

### Returns

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

The original stored value, or `value` when the name was not present.
