diff --git a/Dapper NET40/SqlMapper.cs b/Dapper NET40/SqlMapper.cs index a7efe556c..6ee395c20 100644 --- a/Dapper NET40/SqlMapper.cs +++ b/Dapper NET40/SqlMapper.cs @@ -4312,6 +4312,22 @@ private IEnumerable MultiReadInternal MultiReadInternal(Type[] types, Func map, string splitOn) + { + var identity = this.identity.ForGrid(typeof(TReturn), types, gridIndex); + try + { + foreach (var r in SqlMapper.MultiMapImpl(null, default(CommandDefinition), types, map, splitOn, reader, identity, false)) + { + yield return r; + } + } + finally + { + NextResult(); + } + } + #if CSHARP30 /// /// Read multiple objects from a single record set on the grid @@ -4406,6 +4422,16 @@ public IEnumerable Read(func, splitOn); return buffered ? result.ToList() : result; } + + /// + /// Read multiple objects from a single record set on the grid + /// + public IEnumerable Read(Type[] types, Func map, string splitOn = "id", bool buffered = true) + { + var result = MultiReadInternal(types, map, splitOn); + return buffered ? result.ToList() : result; + } + #endif private IEnumerable ReadDeferred(int index, Func deserializer, Identity typedIdentity)