markrendle/Simple.Data — pull request #242 by philemn (2012-10-26 18:06:06+00:00)
Title: Fix for 'multi-part identifier could not be bound' issue with aliased joins

Hey Mark, I contacted you up on Twitter the other day with regarding this issue. When I attempt to join via an alias the resulting SQL query text is invalid. An error occurs stating that the multi-part identifier could not be bound.

I have included a unit test for the issue and also included a fix. There is quite a bit of work going on to resolve join text so I may have missed something. That said, all existing SQL tests pass with the exception of the TestUpdateWithJoinCriteriaOnCompoundKeyTable test. However, that test never passed for me (could be because the CompoundKey* tables are not created in the DatabaseReset script). Also, I noticed that the resulting query performs an outer join where I would have expected an inner join. What is the intent there?

I hope you find this pull request useful. I'd appreciate your feedback too as this is my first pull request. Awesome job on Simple.Data, it's a wonderful library!