If I have a simple query such as:
string sql = \"SELECT UniqueString, ID FROM Table\";
and I want to map it to a dictionary object such as
For the table of which you do not know the structure at runtime
using var db = new SqlConnection(_connectionString);
var sql = $"Select * From {tableName} Order By {primaryKey}";
var result = await db.QueryAsync(sql);
return result
.Cast>()
.Select(it => it.ToDictionary(it => it.Key, it => it.Value));