Skip to content

Instantly share code, notes, and snippets.

@dcomartin

dcomartin/ExamleInterface.cs Secret

Last active May 26, 2021
Embed
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