读取DapperRow 或者 Object数据

常常获取没有模型或者自义定模型的数据

比如 直接查询,获取到的object 数据

string sqlCount = $"select count(*) as count from Yc_Alarm where 1=1 {where} {order}";
            var cou = DBServerProvider.SqlDapper.QueryFirst<object>(sqlCount,null);
            var data = (IDictionary<string, object>)cou;
            count =int.Parse(data["count"].ToString());

使用IDictionary<string, object> 转换object数据,查看跟踪可以看到是键对值的方式

转载地址:https://www.51wzuan.cn

posted @ 2021-02-08 14:52  夜钓星云  阅读(34)  评论(0)    收藏  举报  来源