Skip to content

Instantly share code, notes, and snippets.

Last active May 26, 2021 21:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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