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
377bf3f4
Commit
377bf3f4
authored
Sep 27, 2011
by
kmontrose
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
a0b36c47
83171792
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
SqlMapper.cs
Dapper/SqlMapper.cs
+18
-6
No files found.
Dapper/SqlMapper.cs
View file @
377bf3f4
...
...
@@ -431,9 +431,12 @@ public static IEnumerable<T> Query<T>(this IDbConnection cnn, string sql, object
}
// nice and simple
identity
=
new
Identity
(
sql
,
commandType
,
cnn
,
null
,
(
object
)
param
==
null
?
null
:
((
object
)
param
).
GetType
(),
null
);
if
((
object
)
param
!=
null
)
{
identity
=
new
Identity
(
sql
,
commandType
,
cnn
,
null
,
(
object
)
param
==
null
?
null
:
((
object
)
param
).
GetType
(),
null
);
info
=
GetCacheInfo
(
identity
);
return
ExecuteCommand
(
cnn
,
transaction
,
sql
,
info
.
ParamReader
,
(
object
)
param
,
commandTimeout
,
commandType
);
}
return
ExecuteCommand
(
cnn
,
transaction
,
sql
,
(
object
)
param
==
null
?
null
:
info
.
ParamReader
,
(
object
)
param
,
commandTimeout
,
commandType
);
}
#if !CSHARP30
/// <summary>
...
...
@@ -828,6 +831,11 @@ public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out obj
return
data
.
TryGetValue
(
binder
.
Name
,
out
result
);
}
public
override
IEnumerable
<
string
>
GetDynamicMemberNames
()
{
return
data
.
Keys
;
}
#
region
IDictionary
<
string
,
object
>
Members
void
IDictionary
<
string
,
object
>.
Add
(
string
key
,
object
value
)
...
...
@@ -867,9 +875,13 @@ public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out obj
return
data
[
key
];
}
set
{
if
(!
data
.
ContainsKey
(
key
))
{
throw
new
NotImplementedException
();
}
data
[
key
]
=
value
;
}
}
#
endregion
...
...
@@ -1214,9 +1226,9 @@ private static IDbCommand SetupCommand(IDbConnection cnn, IDbTransaction transac
}
private
static
int
ExecuteCommand
(
IDbConnection
cnn
,
IDbTransaction
tranaction
,
string
sql
,
Action
<
IDbCommand
,
object
>
paramReader
,
object
obj
,
int
?
commandTimeout
,
CommandType
?
commandType
)
private
static
int
ExecuteCommand
(
IDbConnection
cnn
,
IDbTransaction
tran
s
action
,
string
sql
,
Action
<
IDbCommand
,
object
>
paramReader
,
object
obj
,
int
?
commandTimeout
,
CommandType
?
commandType
)
{
using
(
var
cmd
=
SetupCommand
(
cnn
,
tranaction
,
sql
,
paramReader
,
obj
,
commandTimeout
,
commandType
))
using
(
var
cmd
=
SetupCommand
(
cnn
,
tran
s
action
,
sql
,
paramReader
,
obj
,
commandTimeout
,
commandType
))
{
return
cmd
.
ExecuteNonQuery
();
}
...
...
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