查询返回结果,函数转换 返回

SqlSugar 处理完成
2 119

在我们的应用中,经常碰到需要将16进制换为10进制返回,但是这样的写法就会报错,有没有什么好的办法?


                    var nodeList = await _dbContext.Db.Queryable<SqlModels.StaDevice>()
                         .InnerJoin<SqlModels.Area>((d, a) => d.AreaId == a.AreaId)
                         .WhereIF(levelType == StaLevelType.OrgLevel, (d, a) => a.OrgId == orgId)
                         .WhereIF(levelType == StaLevelType.AreaLevel, (d, a) => a.AreaId == areaId)
                         .Select((d, a) => new
                         {
                             Device10 = Convert.ToInt64(d.UID, 16)
                         })
                         .ToListAsync();

热忱回答2