Skip to content

Commit 71a9452

Browse files
Fixed code snippets
1 parent b027fd5 commit 71a9452

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

15/umbraco-commerce/release-notes/v15.0.0-rc.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,45 +21,47 @@ The key focus of this release is the move to a fully asyncronus code base. In or
2121
Previously all C# API's were synchronous and thus blocking by nature.
2222

2323
```csharp
24-
// Fluent API example
25-
order.AddProduct(productRef, 1)
26-
.SetPaymentMethod(paymentMethodId)
27-
.SetShippingMethod(shippingMethodId);
28-
29-
// Service method examples
30-
orderService.SaveOrder(order);
31-
emailTemplateService.SendEmail(emailTemplateId, order);
32-
33-
// Notification events
34-
public class MyNotification : NotificationEventHandlerBase<OrderFinalizedNotification>
24+
// Fluent API example
25+
order.AddProduct(productRef, 1)
26+
.SetPaymentMethod(paymentMethodId)
27+
.SetShippingMethod(shippingMethodId);
28+
29+
// Service method examples
30+
orderService.SaveOrder(order);
31+
emailTemplateService.SendEmail(emailTemplateId, order);
32+
33+
// Notification events
34+
public class MyNotification : NotificationEventHandlerBase<OrderFinalizedNotification>
35+
{
36+
public override void Handle(OrderFinalizedNotification evt)
3537
{
36-
public override void Handle(OrderFinalizedNotification evt)
37-
{
38-
// Implement your custom logic here
39-
}
38+
// Implement your custom logic here
4039
}
40+
}
4141
```
4242

4343
### New behavior
4444
All API's are now asynchronous and thus are suffixed with Async and return a Task<T> result
4545

46-
// Fluent API example
47-
await order.AddProductAsync(productRef, 1)
48-
.SetPaymentMethodAsync(paymentMethodId)
49-
.SetShippingMethodAsync(shippingMethodId);
50-
51-
// Service method examples
52-
await orderService.SaveOrderAsync(order);
53-
await emailTemplateService.SendEmailAsync(emailTemplateId, order);
54-
55-
// Notification events
56-
public class MyNotification : NotificationEventHandlerBase<OrderFinalizedNotification>
46+
```csharp
47+
// Fluent API example
48+
await order.AddProductAsync(productRef, 1)
49+
.SetPaymentMethodAsync(paymentMethodId)
50+
.SetShippingMethodAsync(shippingMethodId);
51+
52+
// Service method examples
53+
await orderService.SaveOrderAsync(order);
54+
await emailTemplateService.SendEmailAsync(emailTemplateId, order);
55+
56+
// Notification events
57+
public class MyNotification : NotificationEventHandlerBase<OrderFinalizedNotification>
58+
{
59+
public override Task HandleAsync(OrderFinalizedNotification evt, CancelationToken cancelationToken)
5760
{
58-
public override Task HandleAsync(OrderFinalizedNotification evt, CancelationToken cancelationToken)
59-
{
60-
// Implement your custom logic here
61-
}
61+
// Implement your custom logic here
6262
}
63+
}
64+
```
6365

6466
## Storefront API
6567

0 commit comments

Comments
 (0)