With the VS2008 and the May 2010 powerpack release, the following expression generates an error when passed to the query function:
<@ join db.Products db.Categories
(fun p -> p.CategoryID)
(fun c -> Nullable<_>(c.CategoryID))
(fun p c -> (p, c))
|> Seq.sortBy (fun (p, c) -> c.CategoryName)
As I understand it, the SQL translation does not know how to handle tuple.Item2.CategoryName unless it has type information about the members of the tuple. Attached is a diff showing a small change to linq.fs where, when handling Patterns.NewTuple, the Members
member of the NewExpression is initialized by passing a third parameter to Expressions.New. With that change, I am able to execute the above query successfully.
My change may not be the best way to add this support, but I think the support should be added at least for tuples (and possibly for records as well).