Exemple #1
0
        public async Task <IActionResult> GetByCustomerId(string customerId)
        {
            var query  = new CartGetByCustomerIdQuery(customerId);
            var result = await Bus.RequestAsync(query);

            return(Result(HttpStatusCode.OK, result));
        }
Exemple #2
0
        public AbstractApiResult GetByCustomerId(string customerId)
        {
            var query  = new CartGetByCustomerIdQuery(customerId);
            var result = Bus.Request(query);

            if (NotificationHandler.HasNotifications())
            {
                return(ValidationErrorResult());
            }

            return(result.Success
                ? (AbstractApiResult) new SuccessApiResult(HttpStatusCode.OK, result.Data)
                : (AbstractApiResult) new FailureApiResult(HttpStatusCode.BadRequest, result.Message));
        }