Skip to content

Commit 469cf71

Browse files
committed
Don't throw exception if default assigned key isn't an autonumber
1 parent d0db04c commit 469cf71

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Lasy.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>Lasy</id>
5-
<version>1.2.0.7</version>
5+
<version>1.2.0.8</version>
66
<title>Lasy</title>
77
<authors>Trinity Western University</authors>
88
<owners>Brian DeJong</owners>

src/Lasy/AbstractSqlReadWrite.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ public virtual Dictionary<string, object> Insert(string tableName, Dictionary<st
187187

188188
// If there's an autonumber, make sure we add it to the result
189189
var autoNumberKeyName = Analyzer.GetAutoNumberKey(tableName);
190-
if (autoNumberKeyName != null && autoKey == null)
191-
throw new ThisSadlyHappenedException("The SQL ran beautifully, but you were expecting an autogenerated number and you did not get it");
192-
if(autoNumberKeyName != null)
190+
//if (autoNumberKeyName != null && autoKey == null)
191+
// throw new ThisSadlyHappenedException("The SQL ran beautifully, but you were expecting an autogenerated number and you did not get it");
192+
if(autoNumberKeyName != null && autoKey.HasValue)
193193
row = row.Assoc(autoNumberKeyName, autoKey.Value);
194194

195195
// Return the set of primary keys from the insert operation

src/Lasy/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.2.0.7")]
36-
[assembly: AssemblyFileVersion("1.2.0.7")]
35+
[assembly: AssemblyVersion("1.2.0.8")]
36+
[assembly: AssemblyFileVersion("1.2.0.8")]

0 commit comments

Comments
 (0)