这是我的两个表:
publicParking(publicParkingID, address, latitude, longtitude, status,
PricePerHour, maxSpaces, occupiedSpaces, freeSpaces, isOrdered)
Run Code Online (Sandbox Code Playgroud)
和
parkingLot(parkingLotID, address, latitude, longtitude, status,
PricePerHour, maxSpaces, occupiedSpaces, freeSpaces, isOrdered)
Run Code Online (Sandbox Code Playgroud)
除 ID 外,所有列都相同。
我需要在 LINQ 中编写查询,该查询将返回一个按价格排序的表,其中包含所有可用的停车位 ( publicParking/ parkingLot) - with status==true.
该表应如下所示:
ID地址纬度经度状态
我应该做一个联合,还是应该更改表格以便第一列只调用 ID?(而不是publicParkingID和parkingLotID)
我试过这段代码,但它不起作用
var union =
(from lot in parkingLots
where lot.status == true
select lot).Union( from pub in publicParkings
where pub.status==true
select pub);
Run Code Online (Sandbox Code Playgroud)
它给出了这个错误:

我正在使用 LINQPad5 和 tutorialsteacher 的代码编辑器。还有其他选择吗?
我在文件夹中有一个JSON文件App_Data.现在我想读取这个文件并将其保存在JS变量中.这是我写的代码,但它不起作用.
$(document).ready(function () {
$.getJSON("~/App_Data/smartParkTotalJson.json", function(json) {
});
});
Run Code Online (Sandbox Code Playgroud)
UPDATE
现在,我只想检查一下它的读数.所以我写了这段代码:
<script>
$(document).ready(function () {
$.getJSON("/App_Data/smartParkTotalJson.json", function (json) {
alert("sff");
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
我想得到一些警告