如何查询返回字典类型,并带列信息?
#1426
Replies: 2 comments
-
我现在用executereader的方式做了,也不知道还有其它方式不 |
Beta Was this translation helpful? Give feedback.
0 replies
-
List<(string, int)> result = fsql.Select<object>()
.AsTable("tablename")
.OrderBy("column1")
.ToList<(string, int)>("column1, column2");
List<(string, int)> result = fsql.Ado.Query<(string, int)>("select column1, column2 from table"); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xuecat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我现在这个表是动态的,我发现freesql支持字典插入,我很高兴。
但是查询的时候如何返回字典类型呢?
如下(一行数据):
代码的todictionary,结果是{"1": "2"}
我希望是返回的是 {{"column1": 1}, {"column2": 2}}
我现在用datatable做的,请问还有其它方式吗?我总觉的datatable效率没封装的高
Beta Was this translation helpful? Give feedback.
All reactions