private async Task <bool> isQuantityValid(int?orderId, int?productId, short?quantity) { var isQuantityValidQuery = new IsQuantityValidQuery() { OrderId = orderId, ProductId = productId, Quantity = quantity, }; return(await new IsQuantityValidQueryHandler(_context).Handle(isQuantityValidQuery, CancellationToken.None)); }
public async Task <IActionResult> IsQuantityValid(IsQuantityValidQuery isQuantityValidQuery) { return(Ok(await Mediator.Send(isQuantityValidQuery))); }