-
-
Save dcomartin/6261f18b31b2494ab241101eea584f56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GetProductBySkuHandlerDelegateExample : IRequestHandler<GetProductBySkuRequest, ProductViewModel> | |
{ | |
private readonly ProductDelegates.GetProductBySku _getProduct; | |
public GetProductBySkuHandlerDelegateExample(ProductDelegates.GetProductBySku getProduct) | |
{ | |
_getProduct = getProduct; | |
} | |
public async Task<ProductViewModel> Handle(GetProductBySkuRequest request, CancellationToken cancellationToken) | |
{ | |
var product = await _getProduct(request.Sku); | |
return product.ToViewModel(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment