Commit b213df66 authored by Marc Gravell's avatar Marc Gravell

Merge pull request #134 from et1975/master

Query returning empty results should not throw exception
parents af1d9f6f d419b1b2
......@@ -1411,6 +1411,8 @@ private static IEnumerable<T> QueryImpl<T>(this IDbConnection cnn, CommandDefini
int hash = GetColumnHash(reader);
if (tuple.Func == null || tuple.Hash != hash)
{
if (reader.FieldCount == 0) //https://code.google.com/p/dapper-dot-net/issues/detail?id=57
yield break;
tuple = info.Deserializer = new DeserializerState(hash, GetDeserializer(effectiveType, reader, 0, -1, false));
if(command.AddToCache) SetQueryCache(identity, info);
}
......
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