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
bf6404f5
Commit
bf6404f5
authored
Oct 15, 2015
by
Nick Craver
Browse files
Options
Browse Files
Download
Plain Diff
Merge #207 into latest master
parents
c2ed1f40
adf39686
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 @
bf6404f5
...
@@ -2794,37 +2794,40 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj
...
@@ -2794,37 +2794,40 @@ public static void PackListParameters(IDbCommand command, string namePrefix, obj
var
count
=
0
;
var
count
=
0
;
bool
isString
=
value
is
IEnumerable
<
string
>;
bool
isString
=
value
is
IEnumerable
<
string
>;
bool
isDbString
=
value
is
IEnumerable
<
DbString
>;
bool
isDbString
=
value
is
IEnumerable
<
DbString
>;
DbType
dbType
=
0
;
DbType
dbType
=
0
;
foreach
(
var
item
in
list
)
if
(
list
!=
null
)
{
{
if
(
count
++
==
0
)
foreach
(
var
item
in
list
)
{
{
ITypeHandler
handler
;
if
(
count
++
==
0
)
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
)
{
{
listParam
.
Size
=
-
1
;
ITypeHandler
handler
;
dbType
=
LookupDbType
(
item
.
GetType
(),
""
,
true
,
out
handler
);
}
}
}
var
listParam
=
command
.
CreateParameter
();
if
(
isDbString
&&
item
as
DbString
!=
null
)
listParam
.
ParameterName
=
namePrefix
+
count
;
{
if
(
isString
)
var
str
=
item
as
DbString
;
{
str
.
AddParameter
(
command
,
listParam
.
ParameterName
);
listParam
.
Size
=
DbString
.
DefaultLength
;
}
if
(
item
!=
null
&&
((
string
)
item
).
Length
>
DbString
.
DefaultLength
)
else
{
{
listParam
.
Size
=
-
1
;
listParam
.
Value
=
SanitizeParameterValue
(
item
);
}
if
(
listParam
.
DbType
!=
dbType
)
}
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