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
83b47e31
Commit
83b47e31
authored
Oct 15, 2015
by
Nick Craver
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #308 from NikolayGlynchak/master
Added the GridReader.Read method with Type [] types and …
parents
1fb6694f
fad35799
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
SqlMapper.cs
Dapper NET40/SqlMapper.cs
+26
-0
No files found.
Dapper NET40/SqlMapper.cs
View file @
83b47e31
...
...
@@ -4337,6 +4337,22 @@ private IEnumerable<T> ReadImpl<T>(Type type, bool buffered)
}
}
private
IEnumerable
<
TReturn
>
MultiReadInternal
<
TReturn
>(
Type
[]
types
,
Func
<
object
[],
TReturn
>
map
,
string
splitOn
)
{
var
identity
=
this
.
identity
.
ForGrid
(
typeof
(
TReturn
),
types
,
gridIndex
);
try
{
foreach
(
var
r
in
SqlMapper
.
MultiMapImpl
<
TReturn
>(
null
,
default
(
CommandDefinition
),
types
,
map
,
splitOn
,
reader
,
identity
,
false
))
{
yield
return
r
;
}
}
finally
{
NextResult
();
}
}
#if CSHARP30
/// <summary>
/// Read multiple objects from a single record set on the grid
...
...
@@ -4431,6 +4447,16 @@ private IEnumerable<T> ReadImpl<T>(Type type, bool buffered)
var
result
=
MultiReadInternal
<
TFirst
,
TSecond
,
TThird
,
TFourth
,
TFifth
,
TSixth
,
TSeventh
,
TReturn
>(
func
,
splitOn
);
return
buffered
?
result
.
ToList
()
:
result
;
}
/// <summary>
/// Read multiple objects from a single record set on the grid
/// </summary>
public
IEnumerable
<
TReturn
>
Read
<
TReturn
>(
Type
[]
types
,
Func
<
object
[],
TReturn
>
map
,
string
splitOn
=
"id"
,
bool
buffered
=
true
)
{
var
result
=
MultiReadInternal
<
TReturn
>(
types
,
map
,
splitOn
);
return
buffered
?
result
.
ToList
()
:
result
;
}
#endif
private
IEnumerable
<
T
>
ReadDeferred
<
T
>(
int
index
,
Func
<
IDataReader
,
object
>
deserializer
,
Identity
typedIdentity
)
...
...
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