Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 18, 2023 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/1b749712861a3f388a8bc5362e093ab1 to your computer and use it in GitHub Desktop.
Save dcomartin/1b749712861a3f388a8bc5362e093ab1 to your computer and use it in GitHub Desktop.
public class GetOrderQueryHandler : IRequestHandler<GetOrderQuery, OrderResponse>
{
private readonly IOrderService _orderService;
public GetOrderQueryHandler(IOrderService orderService)
{
_orderService = orderService;
}
public async Task<OrderResponse> Handle(GetOrderQuery request)
{
var orderResponse = await _orderService.GetByIdAsync(request.OrderId);
return orderResponse;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment