Skip to content

Commit

Permalink
When adding dynamic properties, fieldName dictionary name not set
Browse files Browse the repository at this point in the history
  • Loading branch information
KorsG committed Dec 12, 2012
1 parent 9f2cbef commit 413a76c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Dapper/SqlMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ internal int AddField(string name)
if (fieldNameLookup.ContainsKey(name)) throw new InvalidOperationException("Field already exists: " + name);
int oldLen = fieldNames.Length;
Array.Resize(ref fieldNames, oldLen + 1); // yes, this is sub-optimal, but this is not the expected common case
fieldNames[oldLen] = name;
fieldNameLookup[name] = oldLen;
return oldLen;
}
Expand Down

0 comments on commit 413a76c

Please sign in to comment.