Esempio n. 1
0
        public async Task Consume(ConsumeContext <GetShoppingCartByCustomerRequest> context)
        {
            var request = context.Message;

            var cart = await builder.GetCartAsync(request);

            var response = new GetShoppingCartResponse(cart, true, ResponseAction.Found);

            await context.RespondAsync(response);
        }
Esempio n. 2
0
        private GetShoppingCartResponse GetCartDTO(Domain.ShoppingCart cart)
        {
            if (cart == null)
            {
                return(new GetShoppingCartResponse(true, ResponseAction.NotFound));
            }
            var cartDTO  = mapper.Map <ShoppingCartDTO>(cart);
            var response = new GetShoppingCartResponse(cartDTO, true, ResponseAction.Found);

            response.ResponseAction = ResponseAction.Found;
            return(response);
        }