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:
Dictionary<string, int> myDictionary = new Dictionary<string, int>();
How would I do this with Dapper?
I assume it is something like:
myDictionary = conn.Query<string, int>(sql, new { }).ToDictionary();
But can't figure out the proper syntax.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…