Just done another commit to the trunk with a bit more functionality working. Here's a couple of tests that now pass:
var q = from c in db.Customers
join o in db.Orders on c.CustomerId equals o.Customer.CustomerId
select new { c.ContactName, o.OrderId };
var q = from c in db.Customers
join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into ords
join e in db.Employees on c.Address.City equals e.Address.City into emps
select new {c.ContactName, ords = ords.Count(), emps = emps.Count()};
var q = from c in db.Customers
join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into orders
select new {c.ContactName, OrderCount = orders.Average(x => x.Freight)};
As before, I'm just working to get the tests passing and it currently wouldn't be hard to get variations of these to fail; for example, I don't yet handle joins on compound keys. However, also as before, I'm getting more confident with the structure and things seem to be moving along nicely.
Next steps are to look at parameterization and polymorphism - the Linq side of things actually does pretty much everything it does here, the changes I need to do are within the HQL parsing subsystem. They shouldn't be hard, so I'm hoping to get them nailed quite quickly.
Oh yeah, also need to get some Asserts into the tests. Right now, they are a pretty fragile safety net :) I know how to do this now in a fairly simple way, so this should also be simple.