public async Task <IActionResult> GetByCustomerId(string customerId) { var query = new CartGetByCustomerIdQuery(customerId); var result = await Bus.RequestAsync(query); return(Result(HttpStatusCode.OK, result)); }
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)); }