# IExclusiveLockCoordinatorGrain Methods

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

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

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

```csharp
[Orleans.Transaction(2)]
public abstract 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-af4aaeaa}

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

```csharp
[Orleans.Transaction(2)]
public abstract 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`)
