public async Task <IActionResult> RemoveProduct( [FromServices] Func <RemoveProductItemFromShoppingCart, CancellationToken, ValueTask> handle, Guid id, [FromBody] RemoveProductRequest request, CancellationToken ct ) { if (request == null) { throw new ArgumentNullException(nameof(request)); } var command = RemoveProductItemFromShoppingCart.From( id, PricedProductItem.From( ProductItem.From( request.ProductItem?.ProductId, request.ProductItem?.Quantity ), request.ProductItem?.UnitPrice ), request.Version ); await handle(command, ct); return(Ok()); }