Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. var customerDTOs = from customer in GetAllCustomers()
  2. where customer.Email == "some@email.com"
  3. select new CustomerDTO
  4. {
  5. Id = customer.Id,
  6. Name = customer.Name,
  7. OrderId = customer.Orders.Select(x => x.Id).FirstOrDefault()
  8. }
  9.  
  10. select customers.Id, customers.Name,
  11. (select orders.Id from order_customer, orders
  12. where customers.Id = order_customer.customerId
  13. and order_customer.orderId = orders.Id
  14. limit 1))
  15. from customers
  16. where customers.Email='some@email.com'
  17.  
  18. select customers.Id, customers.Name,
  19. (select order_customer.orderId from order_customer
  20. where customers.Id = order_customer.customerId
  21. limit 1))
  22. from customers
  23. where customers.Email='some@email.com'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement