# TransactionManagerExtension.PrepareAndCommit(string, Guid, AccessCounter, DateTime, List&lt;ParticipantId&gt;, int, CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.transactions/orleans.transactions.transactionmanagerextension/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.transactions/orleans.transactions.transactionmanagerextension/methods/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Orleans.Transactions/DistributedTM/TransactionManagerExtension.cs#L53)

```csharp
public Task<TransactionalStatus> PrepareAndCommit(string resourceId, Guid transactionId, AccessCounter accessCount, DateTime timeStamp, List<ParticipantId> writeResources, int totalResources, CancellationToken cancellationToken)
```

Requests that the specified transaction manager prepare and commit a transaction.

### Parameters

- `resourceId` (`string`): The identifier of the transaction manager resource.
- `transactionId` (`Guid`): The transaction identifier.
- `accessCount` (`AccessCounter`): The number of reads and writes performed on the transaction manager by the transaction.
- `timeStamp` (`DateTime`): The transaction commit timestamp.
- `writeResources` (`List<ParticipantId>`): The participants which wrote during the transaction.
- `totalResources` (`int`): The total number of participants in the transaction.
- `cancellationToken` (`CancellationToken`): The token used to cancel the operation.

### Returns

A task whose result is the final transaction status.
