From 6daac40d2900e29d5f85c569d7d9b13014dc3a8d Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sun, 12 Sep 2010 11:51:31 +0000 Subject: [PATCH] InsertOrUpdateChange saves ID on insert --- Common/actions/InsertOrUpdateChange.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Common/actions/InsertOrUpdateChange.cs b/Common/actions/InsertOrUpdateChange.cs index 998350f..8f3b9c1 100644 --- a/Common/actions/InsertOrUpdateChange.cs +++ b/Common/actions/InsertOrUpdateChange.cs @@ -66,11 +66,14 @@ namespace FLocal.Common.actions { foreach(KeyValuePair kvp in this.dataToInsert) { processedData[kvp.Key] = kvp.Value.getStringRepresentation(); } - Config.instance.mainConnection.insert( + this.id = int.Parse(Config.instance.mainConnection.insert( transaction, this.tableSpec, processedData - ); + )); + if(processedData.ContainsKey(this.tableSpec.idName)) { + this.id = int.Parse(processedData[this.tableSpec.idName]); + } } }