Ejemplo n.º 1
0
        public async Task <bool> DeleteCartItemAsync(string userId, int orderItemId)
        {
            using var log = BeginFunction(nameof(CartUserService), nameof(DeleteCartItemAsync), userId, orderItemId);
            try
            {
                //AssertIsEndUser(userId);
                await Assert(SecurityPolicy.IsAuthorized, userId).ConfigureAwait(false);

                var ordererReference = CreateOrdererReference.FromUserId(userId);
                var ordererId        = await OrderMicroService.AllocateOrdererAsync(ordererReference).ConfigureAwait(false);

                var result = await OrderMicroService.DeleteCartItemAsync(ordererId, orderItemId).ConfigureAwait(false);

                log.Result(result);

                return(result);
            }
            catch (Exception ex)
            {
                log.Exception(ex);
                throw;
            }
        }