Skip to content

Instantly share code, notes, and snippets.

@hahmed
Created August 20, 2012 11:49
Show Gist options
  • Select an option

  • Save hahmed/3403465 to your computer and use it in GitHub Desktop.

Select an option

Save hahmed/3403465 to your computer and use it in GitHub Desktop.
interesting query
Map = orders => from order in orders
let lastPayment = order.Payments.LastOrDefault()
select new
{
Query = new object[]
{
order.FirstName,
order.LastName,
order.OrderNumber,
order.Email,
order.Email.Split('@'),
order.CompanyName,
order.Payments.Select(payment => payment.PaymentIdentifier),
order.LicenseIds
},
LastPaymentDate = lastPayment == null ? order.OrderedAt : lastPayment.At
};
@hahmed
Copy link
Copy Markdown
Author

hahmed commented Aug 20, 2012

did not know i could do something like this

@hahmed
Copy link
Copy Markdown
Author

hahmed commented Sep 4, 2012

mapping stuff looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment