Skip to content

Commit

Permalink
Merge pull request sqlkata#419 from sqlkata/fix/get-dictionnary-async…
Browse files Browse the repository at this point in the history
…-null

fix GetDictionaryAsync returns null https://github.com/sqlkata/queryb…
  • Loading branch information
ahmad-moussawi authored Oct 7, 2020
2 parents 92eaeb0 + 2bcaac1 commit 4f74f04
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SqlKata.Execution/QueryFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ public IEnumerable<IDictionary<string, object>> GetDictionary(Query query, IDbTr
{
var compiled = CompileAndLog(query);

return this.Connection.Query(
var result = this.Connection.Query(
compiled.Sql,
compiled.NamedBindings,
transaction: transaction,
commandTimeout: timeout ?? this.QueryTimeout
) as IEnumerable<IDictionary<string, object>>;
);

return result.Cast<IDictionary<string, object>>();
}

public async Task<IEnumerable<IDictionary<string, object>>> GetDictionaryAsync(Query query, IDbTransaction transaction = null, int? timeout = null)
Expand All @@ -126,7 +128,7 @@ public async Task<IEnumerable<IDictionary<string, object>>> GetDictionaryAsync(Q
commandTimeout: timeout ?? this.QueryTimeout
);

return result as IEnumerable<IDictionary<string, object>>;
return result.Cast<IDictionary<string, object>>();
}

public IEnumerable<dynamic> Get(Query query, IDbTransaction transaction = null, int? timeout = null)
Expand Down

0 comments on commit 4f74f04

Please sign in to comment.