我正在使用 MVC c# 我有一个对象
public class Person
{
public int TypeId { get; set; }
public string Code { get; set; }
}
我有一个代码可以像这样为这个对象重新运行 JSON 对象
return Json(personCodeStore.GetPersonCodes(id).Select(x=>new {text =x.Code, value =x.TypeId}), JsonRequestBehavior.AllowGet);
如何在我的 JSON 返回数据中添加一个指标,以便我可以检查空数据
$.getJSON('../PersonList?id=1', function (data) {
if (data==????)
{
alert("has data");
}
else
{
alert("is Empty");
}
}