-
-
Save dcomartin/056a90f7a31b9118ec4c831cc587cc2d 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 GetProductBySkuHandler : IRequestHandler<GetProductBySkuRequest, ProductViewModel> | |
{ | |
private readonly IProductService _productService; | |
public GetProductBySkuHandler(IProductService productService) | |
{ | |
_productService = productService; | |
} | |
public async Task<ProductViewModel> Handle(GetProductBySkuRequest request, CancellationToken cancellationToken) | |
{ | |
var product = await _productService.GetProductBySku(request.Sku); | |
return product.ToViewModel(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment