Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 16, 2024 21:34
Show Gist options
  • Save dcomartin/80c43946d487a122b2053ba23a4d3c57 to your computer and use it in GitHub Desktop.
Save dcomartin/80c43946d487a122b2053ba23a4d3c57 to your computer and use it in GitHub Desktop.
[HttpGet("{orderId}")]
public async Task<IActionResult> Detail(int orderId)
{
var viewModel = await _mediator.Send(new GetOrderDetails(User.Identity.Name, orderId));
return viewModel.Match<IActionResult>(
some: result => View(result),
none: () => NotFound("Order Not Found"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment