Translating joins

Developer
Sep 10, 2014 at 9:30 AM
How to translate the following examples
Need to be able to translate the following examples, but these need some consideration first.
Any ideas are welcome
1.)
                from c in db.Customers
                join o in db.Orders on c.CustomerID equals o.CustomerID
                select new { c.ContactName, o.OrderID }
2)
                from c in db.Customers
                join o in db.Orders on new { a = c.CustomerID, b = c.CustomerID } equals new { a = o.CustomerID, b = o.CustomerID }
                select new { c, o }
3.
                from c in db.Customers
                join o in db.Orders on c.CustomerID equals o.CustomerID into ords
                select new { cust = c, ords = ords.ToList() }
4.
                from c in db.Customers
                join o in db.Orders on c.CustomerID equals o.CustomerID into ords
                select new { cust = c, ords = ords.Count() }
5.
                from c in db.Customers
                join o in db.Orders on c.CustomerID equals o.CustomerID into ords
                from o in ords.DefaultIfEmpty()
                select new { c, o }