Commit ad656ad8 authored by Sam Saffron's avatar Sam Saffron

remove buffered ... in this case I do not think it helps

parent b87c6c1d
...@@ -778,15 +778,14 @@ internal GridReader(IDbCommand command, IDataReader reader, IDbConnection connec ...@@ -778,15 +778,14 @@ internal GridReader(IDbCommand command, IDataReader reader, IDbConnection connec
/// <summary> /// <summary>
/// Read the next grid of results /// Read the next grid of results
/// </summary> /// </summary>
public IEnumerable<T> Read<T>(bool buffered = true) public IEnumerable<T> Read<T>()
{ {
if (reader == null) throw new ObjectDisposedException(GetType().Name); if (reader == null) throw new ObjectDisposedException(GetType().Name);
if (consumed) throw new InvalidOperationException("Each grid can only be iterated once"); if (consumed) throw new InvalidOperationException("Each grid can only be iterated once");
var identity = new Identity(sql, connection, typeof(T), null); var identity = new Identity(sql, connection, typeof(T), null);
var deserializer = SqlMapper.GetDeserializer<T>(identity, reader); var deserializer = SqlMapper.GetDeserializer<T>(identity, reader);
consumed = true; consumed = true;
var results = ReadDeferred(gridIndex, deserializer); return ReadDeferred(gridIndex, deserializer);
return buffered ? results.ToList() : results;
} }
// todo multimapping. // todo multimapping.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment