ServiceStack/ServiceStack.OrmLite — pull request #300 by WimAtIHomer (2013-08-09 10:30:20+00:00)
Title: Fix for Can_GetLastInsertedId_using_InsertParam

GetLastInsertedId didn't work because the Insert statement in InsertParam is executed with sp_executesql which is executed in a different scope (see http://stackoverflow.com/questions/7298030/why-scope-identity-returns-null).
The only solution I see is to execute SCOPE_IDENTITY() with the insert statement and store this result in the OrmLiteConnection for GetLastInsertedId to retreive later. This is implemented in this pull request.