Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
25633385
Commit
25633385
authored
Apr 23, 2011
by
Sam Saffron
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
603e58cc
dc398803
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
SqlMapper.cs
Dapper/SqlMapper.cs
+10
-5
No files found.
Dapper/SqlMapper.cs
View file @
25633385
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment