Created
March 19, 2021 14:57
-
-
Save sviataslau/376d16b7477f757bad63d36909a36332 to your computer and use it in GitHub Desktop.
Resilience
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<ActionResult> BuyProductAsync(ProductPurchase purchase) { | |
Customer customer = await dbContext.Customers.FindAsync(purchase.CustomerId); | |
Order order = await orderService.CreateOrderAsync(customer, purchase); | |
Payment payment = await paymentService.PostPaymentAsync(order); | |
await emailService.SendEmailAsync(customer.Email, new Email("Payment was processed!")); | |
await bus.PublishAsync(new OrderCreatedEvent { Id = order.Id }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment