Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active November 8, 2023 19:09
Show Gist options
  • Save dcomartin/3930720ea0bd393a3c0fb022a56ea0eb to your computer and use it in GitHub Desktop.
Save dcomartin/3930720ea0bd393a3c0fb022a56ea0eb to your computer and use it in GitHub Desktop.
var order = await _context.Orders
.Where(x => x.OrderId == orderId)
.Select(x => new OrderResponse
{
OrderDate = x.OrderDate,
OrderNumber = x.OrderNumber,
ShippingAddress = x.ShippingAddress,
Total = x.Total()
})
.FirstOrDefaultAsync();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment