Async Inserts Yield Empty Guid Ids

I am currently using ServiceStack 5.1.0

We have read the following post regarding MSSQL Guids and AutoId:

[Guid return on insert][1]
[1]: Guid return on insert

This behavior works as expected for all synchronous operations. However, when we use SaveAsync or InsertAsync the POCO Id (annotated with the [AutoId] attribute) is not populated. NOTE: The DB record is created as expected.

In the unit tests it ‘appears’ that GetLastInsertIdSqlSuffix is utilized within the synchronized operations but omitted from their async counterparts. I am not quite sure if this is the issue or not.

Your help would be appreciated.

Thank you

I’m unable to repro this with the Async versions of the [AutoId] tests in this commit.

Please provide a stand-alone repro which repros the issue with the latest v5.1.1 on MyGet as maybe it has already been resolved.

We can certainly create a stand-alone repro. However, it might help to note that we pulled the tests you referred to locally (along with the latest version of ServiceStack from MyGet). We changed the test to simply connect to a MSSQL db rather than the default used in the original test.

Attached you will find the results:

If you still require a stand-alone repro, you will have it.

Thank you for your help.

Ok thanks should be resolved from this commit which is available from v5.1.1 that’s now on MyGet.

As you had v5.1.1 installed you will need to clear your NuGet cache to download the latest version:

$ nuget locals all -clear
1 Like

Thank you sir.

You have been more than accommodating.

2 Likes