Commit 25633385 authored by Sam Saffron's avatar Sam Saffron

merge

parents 603e58cc dc398803
...@@ -106,10 +106,13 @@ internal Identity(string sql, IDbConnection cnn, Type type) ...@@ -106,10 +106,13 @@ internal Identity(string sql, IDbConnection cnn, Type type)
this.sql = sql; this.sql = sql;
this.connectionString = cnn.ConnectionString; this.connectionString = cnn.ConnectionString;
this.type = type; this.type = type;
hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this unchecked
hashCode = hashCode * 23 + (sql == null ? 0 : sql.GetHashCode()); {
hashCode = hashCode * 23 + (type == null ? 0 : type.GetHashCode()); hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this
hashCode = hashCode * 23 + (connectionString == null ? 0 : connectionString.GetHashCode()); hashCode = hashCode * 23 + (sql == null ? 0 : sql.GetHashCode());
hashCode = hashCode * 23 + (type == null ? 0 : type.GetHashCode());
hashCode = hashCode * 23 + (connectionString == null ? 0 : connectionString.GetHashCode());
}
} }
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
...@@ -463,7 +466,9 @@ private static object GetStructDeserializer<T>(IDataReader reader) ...@@ -463,7 +466,9 @@ private static object GetStructDeserializer<T>(IDataReader reader)
var setters = ( var setters = (
from n in names from n in names
select new { Name = n, Info = properties.FirstOrDefault(p => p.Name == n) } let prop = properties.FirstOrDefault(p => string.Equals(p.Name, n, StringComparison.InvariantCulture)) // case sensitive first
?? properties.FirstOrDefault(p => string.Equals(p.Name, n, StringComparison.InvariantCultureIgnoreCase)) // case insensitive second
select new { Name = n, Info = prop }
).ToList(); ).ToList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment