Integrating an HTTP client into the cart service

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 ...

Get Hands-On RESTful Web Services with ASP.NET Core 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.