The next step is to incorporate the HTTP client provided by the catalog service into the cart service. Therefore, we will add a new class whose ownership is to call the catalog service and retrieve the information that's required for the specific cart. Let's start by creating an interface in the Cart.Domain project called ICatalogService:
using System.Threading;using System.Threading.Tasks;using Cart.Domain.Responses.Cart;namespace Cart.Domain.Services{ public interface ICatalogService { Task<CartItemResponse> EnrichCartItem(CartItemResponse item, CancellationToken cancellationToken); }}
The ICatalogService interface is contained in the Services folder of the Cart.Domain project. It exposes ...