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
4c6f5b95
Commit
4c6f5b95
authored
Oct 15, 2015
by
Nick Craver
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jdaigle-master'
parents
c2ed1f40
bf6404f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
25 deletions
+28
-25
SqlMapper.cs
Dapper NET40/SqlMapper.cs
+28
-25
No files found.
Dapper NET40/SqlMapper.cs
View file @
4c6f5b95
...
...
@@ -2794,37 +2794,40 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj
var
count
=
0
;
bool
isString
=
value
is
IEnumerable
<
string
>;
bool
isDbString
=
value
is
IEnumerable
<
DbString
>;
DbType
dbType
=
0
;
foreach
(
var
item
in
list
)
DbType
dbType
=
0
;
if
(
list
!=
null
)
{
if
(
count
++
==
0
)
foreach
(
var
item
in
list
)
{
ITypeHandler
handler
;
dbType
=
LookupDbType
(
item
.
GetType
(),
""
,
true
,
out
handler
);
}
var
listParam
=
command
.
CreateParameter
();
listParam
.
ParameterName
=
namePrefix
+
count
;
if
(
isString
)
{
listParam
.
Size
=
DbString
.
DefaultLength
;
if
(
item
!=
null
&&
((
string
)
item
).
Length
>
DbString
.
DefaultLength
)
if
(
count
++
==
0
)
{
listParam
.
Size
=
-
1
;
ITypeHandler
handler
;
dbType
=
LookupDbType
(
item
.
GetType
(),
""
,
true
,
out
handler
);
}
}
if
(
isDbString
&&
item
as
DbString
!=
null
)
{
var
str
=
item
as
DbString
;
str
.
AddParameter
(
command
,
listParam
.
ParameterName
);
}
else
{
listParam
.
Value
=
SanitizeParameterValue
(
item
);
if
(
listParam
.
DbType
!=
dbType
)
var
listParam
=
command
.
CreateParameter
();
listParam
.
ParameterName
=
namePrefix
+
count
;
if
(
isString
)
{
listParam
.
Size
=
DbString
.
DefaultLength
;
if
(
item
!=
null
&&
((
string
)
item
).
Length
>
DbString
.
DefaultLength
)
{
listParam
.
Size
=
-
1
;
}
}
if
(
isDbString
&&
item
as
DbString
!=
null
)
{
var
str
=
item
as
DbString
;
str
.
AddParameter
(
command
,
listParam
.
ParameterName
);
}
else
{
listParam
.
DbType
=
dbType
;
listParam
.
Value
=
SanitizeParameterValue
(
item
);
if
(
listParam
.
DbType
!=
dbType
)
{
listParam
.
DbType
=
dbType
;
}
command
.
Parameters
.
Add
(
listParam
);
}
command
.
Parameters
.
Add
(
listParam
);
}
}
...
...
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