# ExclusiveLockCoordinatorGrain Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.base/orleans.transactions.testkit.exclusivelockcoordinatorgrain/)

## ReadThenWrite(ITransactionTestGrain, int) {#readthenwrite-orleans-transactions-testkit-itransactiontestgrain-int-fc8017bf}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.base/orleans.transactions.testkit.exclusivelockcoordinatorgrain/methods/readthenwrite-orleans-transactions-testkit-itransactiontestgrain-int-fc8017bf/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Transactions.TestKit.Base/Grains/ExclusiveLockCoordinatorGrain.cs#L11-L14)

```csharp
public Task ReadThenWrite(ITransactionTestGrain grain, int value)
```

Performs a Read-then-Write pattern on a grain without exclusive lock.

### Parameters

- `grain` (`ITransactionTestGrain`)
- `value` (`int`)

## ReadThenWriteWithExclusiveLock(IExclusiveLockTransactionTestGrain, int) {#readthenwritewithexclusivelock-orleans-transactions-testkit-iexclusivelocktransa-47f9a48f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.base/orleans.transactions.testkit.exclusivelockcoordinatorgrain/methods/readthenwritewithexclusivelock-orleans-transactions-testkit-iexclusivelocktransa-47f9a48f/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Transactions.TestKit.Base/Grains/ExclusiveLockCoordinatorGrain.cs#L18-L21)

```csharp
public Task ReadThenWriteWithExclusiveLock(IExclusiveLockTransactionTestGrain grain, int value)
```

Performs a Read-then-Write pattern on a grain with exclusive lock on reads. The exclusive lock prevents lock upgrade conflicts under concurrent execution.

### Parameters

- `grain` (`IExclusiveLockTransactionTestGrain`)
- `value` (`int`)
