The UpdateAsync method in version 2.0.1 attempts to write primary key values on update. This causes an exception on SQL Server where the primary keys are identities.
This fix is in the main branch of PetaPoco’s Database class in the ExecuteUpdate method:
// Don't update the primary key, but grab the value if we don't have it
if (string.Compare(i.Key, primaryKeyName, true) == 0)
{
if (primaryKeyValue == null)
primaryKeyValue = i.Value.GetValue(poco);
continue;
}
The UpdateAsync method in version 2.0.1 attempts to write primary key values on update. This causes an exception on SQL Server where the primary keys are identities.
This fix is in the main branch of PetaPoco’s Database class in the ExecuteUpdate method:
https://github.com/tmenier/AsyncPoco/blob/02863e6a0387faff4fbb607f0725248b2bc55f13/AsyncPoco/Database.cs#L1305