robconery/massive — pull request #107 by jbubriski (2011-11-11 19:36:59+00:00)
Title: Fixes for the Save() and Insert() methods in respect to POCO's.

The Save() method said it could take POCO's, but the POCO's would never get converted to ExpandoObjects and would throw an exception in CreateUpdateCommand and CreateInsertCommand. Fixed by calling ToExpando() on the object(s) before calling those methods.

Another issue was that if a POCO is used to do an Insert() and the PrimaryKeyField exists on that POCO the insert will fail, assuming that the PrimaryKeyField has an Identity Specification (which is normal). The solution (at least for now), is to automatically exclude the PrimaryKeyField from the ToExpando() operation so it doesn't get put into the generated SQL.