我希望得到温度列的5个前10个记录,并希望转换为json数据。我试过这样但没有得到理想的值
{"成功":真," sensorsdata" {" WaterTemperature":" 33.33"}}
using (smartpondEntities DB = new smartpondEntities())
{
var parkingSlot = DB.ParkingSlots.OrderByDescending(x => x.CurrentTime).Select(x => x.WaterTemperature).Take(5);
return Json(new { success = true, sensorsdata = new { WaterTemperature = "33.33" } }, JsonRequestBehavior.AllowGet);
}