ServiceStack/ServiceStack.OrmLite — pull request #383 by BruceCowan-AI (2014-05-23 21:29:48+00:00)
Title: Fix Reference attribute usage with tables that have alias names.

Hi Demis,

This PR fixes the problem I emailed you about and it maintains compatibility with the old way of doing it for the most common case of no alias on the foreign key property. If someone previously used an alias on the foreign key property that does not match the expected value, then LoadReferences/SaveReferences etc. will fail. That seems good enough to me, but obviously the code in OrmLiteReadExtensions could be changed to do a FieldName query and if that fails then try a Name query before giving up.

Cheers, Bruce