问题标签 [linq-to-mysql]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
244 浏览

c# - orderby 无法使用 LINQ 在子查询中获得前 1 个结果

我正在尝试使用子查询从子表中获取前 1 个结果。当我尝试使用orderby or OrderByDescending使用子查询时,它会抛出

空引用异常

. 不使用orderby or OrderByDescending我的查询成功执行。但我想获得子查询的最后一条记录。我的应用程序与 Mysql 数据库连接。

我的代码在下面给出