Skip to content

Commit 0b9835d

Browse files
Replace uow.Complete
1 parent 553417a commit 0b9835d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

15/umbraco-commerce/key-concepts/fluent-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ await _uowProvider.ExecuteAsync(async (uow) =>
2626
await _currencyService.SaveCurrencyAsync(currency);
2727

2828
// Close the transaction
29-
await uow.CompleteAsync();
29+
uow.Complete();
3030
});
3131

3232
```
@@ -42,7 +42,7 @@ await _uowProvider.ExecuteAsync(async (uow) =>
4242

4343
await _currencyService.SaveCurrencyAsync(currency);
4444

45-
await uow.CompleteAsync();
45+
uow.Complete();
4646
});
4747

4848
```

15/umbraco-commerce/key-concepts/readonly-and-writable-entities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ await _uowProvider.ExecuteAsync(async (uow) =>
3535
await _currencyService.SaveCurrencyAsync(currency);
3636

3737
// Close our transaction
38-
await uow.CompleteAsync();
38+
uow.Complete();
3939
});
4040

4141
```

15/umbraco-commerce/key-concepts/unit-of-work.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ await _uowProvider.ExecuteAsync(async (uow) =>
1919
{
2020
// Perform your write operations here
2121
22-
await uow.CompleteAsync();
22+
uow.Complete();
2323
});
2424

2525
```
2626

27-
The anatomy of a Unit of Work is an `ExecuteAsync` method call on the `IUnitOfWorkProvider` instance which accepts an async delegate function with a `uow` argument. Inside the delegate, we perform our tasks and confirm the Unit of Work as complete by calling `await uow.CompleteAsync()`. If we fail to call `await uow.CompleteAsync()` either due to forgetting to add the `await uow.CompleteAsync()` call or due to an exception in our code, then any write operations that occur within that code block will **not** be persisted in the database.
27+
The anatomy of a Unit of Work is an `ExecuteAsync` method call on the `IUnitOfWorkProvider` instance which accepts an async delegate function with a `uow` argument. Inside the delegate, we perform our tasks and confirm the Unit of Work as complete by calling `uow.Complete()`. If we fail to call `uow.Complete()` either due to forgetting to add the `uow.Complete()` call or due to an exception in our code, then any write operations that occur within that code block will **not** be persisted in the database.
2828

2929
### Unit of Work Best Practice
3030

@@ -47,7 +47,7 @@ await _uowProvider.ExecuteAsync(async (uow) =>
4747

4848
await _currencyService.SaveCurrencyAsync(currency);
4949

50-
await uow.CompleteAsync();
50+
uow.Complete();
5151
});
5252
```
5353

@@ -63,7 +63,7 @@ await _uowProvider.ExecuteAsync(async (uow) =>
6363

6464
await _countryService.SaveCountryAsync(country);
6565

66-
await uow.CompleteAsync();
66+
uow.Complete();
6767
});
6868

6969
await _uowProvider.ExecuteAsync(async (uow) =>
@@ -73,6 +73,6 @@ await _uowProvider.ExecuteAsync(async (uow) =>
7373

7474
await _currencyService.SaveCurrencyAsync(currency);
7575

76-
await uow.CompleteAsync();
76+
uow.Complete();
7777
});
7878
```

0 commit comments

Comments
 (0)