December 2019
Intermediate to advanced
510 pages
11h 33m
English
Let's start by creating a handler that manages the sold-out condition of a product in the cart service. First of all, we should proceed by adding the RabbitMQ.Client package to the Cart.Domain project by executing the following command:
dotnet add ./src/Cart.Domain package RabbitMQ.Client
We can continue by defining a class that represents the sold-out event that's used by the cart service in a new project that will contain all of the events. Therefore, we will proceed by creating a new ItemSoldOutEvent type, which represents a sold-out event:
using MediatR;namespace Cart.Domain.Events{ public class ItemSoldOutEvent : IRequest<Unit> { public string Id { get; set; } }}
The ItemSoldOutEvent type contains a reference ...
Read now
Unlock full access